NAME

EventStore::Tiny::DataEvent

REFERENCE

EventStore::Tiny::DataEvent extends EventStore::Tiny::Event and implements the following additional attributes and methods.

data

my $ev = EventStore::Tiny::DataEvent->new(data => {id => 42});

Sets concrete data for this event which will be used during application.

new_from_template

my $concrete = EventStore::Tiny::DataEvent->new_from_template(
    $event, {id => 17}
);

Creates a new data event based on another event (usually representing an EventStore::Tiny::Event event type which was registered before using "register_event" in EventStore::Tiny). The additional argument sets the new event's "data" attribute.

apply_to

$event->apply_to(\%state, $logger);

Applies this event's transformation to the given state (by side-effect) and its "data". If a $logger as a subref is given, it is used to log this application.

summary

say $event->summary;

Extended version of "summary" in EventStory::Tiny::Event from the parent. It features a simple "data" summary.

SEE ALSO

EventStore::Tiny

COPYRIGHT AND LICENSE

Copyright (c) 2018 Mirko Westermeier (mail: mirko@westermeier.de)

Released under the MIT License (see LICENSE.txt for details).