first test for observer code
[scpubgit/DKit.git] / lib / DX / Var.pm
CommitLineData
60cda014 1package DX::Var;
2
3use Moo;
4
5has id => (is => 'ro', required => 1);
6
7has bound_stream => (is => 'ro');
8
9has bound_value => (is => 'lazy', clearer => 1, builder => sub {
10 $_[0]->bound_stream->next;
11});
12
13sub with_stream {
14 my ($self, $stream) = @_;
15 $self->new(%$self, bound_stream => $stream);
16}
17
b40d5c51 18sub with_value {
19 my ($self, $stream) = @_;
20 $self->new(%$self, bound_value => $stream);
21}
22
60cda014 231;