EventStore::Tiny::Event
EventStore::Tiny::Event implements the following attributes and methods.
All these attributes can be manipulated by setters/getters with the attribute's name or can be set on construction:
my $event = EventStore::Tiny::Event->new(name => "Foo");
This event's UUID. By default a new UUID is created.
This event's timestamp. By default a new timestamp of the creation time is set.
This event's name. Setting this attribute on construction is required.
This event's state transformation function, represented by a subref. By default it does nothing, so it should be set as a reasonable subref changing the given state argument (as a hashref) based on the given data (as a hashref) by side-effect.
$event->apply_to(\%state, $logger);
Applies this event's transformation to the given state (by side-effect). If a $logger as a subref is given, it is used to log this application.
$logger
EventStore::Tiny
Copyright (c) 2018 Mirko Westermeier (mail: mirko@westermeier.de)
Released under the MIT License (see LICENSE.txt for details).
To install EventStore::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm EventStore::Tiny
CPAN shell
perl -MCPAN -e shell install EventStore::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.