line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:YANICK'; |
2
|
|
|
|
|
|
|
# ABSTRACT: Observable role for MobX scalars |
3
|
|
|
|
|
|
|
$MoobX::Scalar::Observable::VERSION = '0.1.2'; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use 5.20.0; |
6
|
6
|
|
|
6
|
|
3221
|
|
|
6
|
|
|
|
|
19
|
|
7
|
|
|
|
|
|
|
use Moose::Role; |
8
|
6
|
|
|
6
|
|
30
|
|
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
106
|
|
9
|
|
|
|
|
|
|
use Scalar::Util 'refaddr'; |
10
|
6
|
|
|
6
|
|
28799
|
|
|
6
|
|
|
|
|
16
|
|
|
6
|
|
|
|
|
1192
|
|
11
|
|
|
|
|
|
|
before 'FETCH' => sub { |
12
|
|
|
|
|
|
|
my $self = shift; |
13
|
|
|
|
|
|
|
push @MoobX::DEPENDENCIES, $self if $MoobX::WATCHING; |
14
|
|
|
|
|
|
|
}; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
after 'STORE' => sub { |
17
|
|
|
|
|
|
|
my $self = shift; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
MoobX::observable_ref($self->value) if ref $self->value; |
20
|
|
|
|
|
|
|
MoobX::observable_modified( $self ); |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=pod |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=encoding UTF-8 |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
MoobX::Scalar::Observable - Observable role for MobX scalars |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 VERSION |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
version 0.1.2 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 DESCRIPTION |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Role applied to L<MoobX::Scalar> objects to make them observables. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Used internally by L<MoobX>. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 AUTHOR |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Yanick Champoux <yanick@cpan.org> |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
This software is copyright (c) 2022, 2017 by Yanick Champoux. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
53
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |