View<S, E> class final

Projects events into denormalized or query-ready state.

A view is the query-side counterpart to a decider: it has no command handling behavior and only evolves state from events.

Implemented types
Available extensions

Constructors

View({required S initialState, required Evolve<S, E> evolve})
Creates a View.
const

Properties

evolve Evolve<S, E>
Pure function that applies an event to a state.
final
hashCode int
The hash code for this object.
no setterinherited
initialState → S
State used before any events have been applied.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dimapOnState<Sn>({required S fr(Sn state), required Sn fl(S state)}) View<Sn, E>

Available on View<S, E>, provided by the ViewDimapOnStateExt extension

Transforms the input/output state type.
mapLeftOnEvent<En>(E funcL(En event)) View<S, En>

Available on View<S, E>, provided by the ViewMapLeftOnEventExt extension

Adapts this view to accept another event type.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited