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