Decider<C, S, E> class
final
Decides which events should happen for a command and state.
A decider is the core domain model for command handling: decide emits events and evolve folds those events back into state.
- Implemented types
-
- DeciderContract<
C, S, E>
- DeciderContract<
- Available extensions
Constructors
Properties
-
decide
→ Decide<
C, S, E> -
Function that emits events for a command and current state.
final
-
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
-
combine<
C2 extends CSuper, S2, E2 extends ESuper> (Decider< C2, S2, E2> other) → Decider<CSuper, (S, S2), ESuper> -
Available on Decider<
Combines two deciders into one tuple-state decider.C, S, E> , provided by the DeciderCombineExt extension -
combineViaMerge<
C2 extends CSuper, S2, E2 extends ESuper, SMerged> (Decider< C2, S2, E2> other, {required S leftState(SMerged state), required S2 rightState(SMerged state), required SMerged mergeState(S left, S2 right)}) → Decider<CSuper, SMerged, ESuper> -
Available on Decider<
Combines two deciders and merges their states intoC, S, E> , provided by the DeciderCombineExt extensionSMerged. -
combineViaTuples<
C2 extends CSuper, S2, E2 extends ESuper> (Decider< C2, S2, E2> other) → Decider<CSuper, (S, S2), ESuper> -
Available on Decider<
Combines two deciders and keeps their states as a tupleC, S, E> , provided by the DeciderCombineExt extension(S, S2). -
dimapOnEvent<
En> ({required E fl(En), required En fr(E)}) → Decider< C, S, En> -
Available on Decider<
Adapts this decider's event type in both directions.C, S, E> , provided by the DeciderMapExt extension -
dimapOnState<
Sn> ({required S fl(Sn), required Sn fr(S)}) → Decider< C, Sn, E> -
Available on Decider<
Adapts this decider's state type in both directions.C, S, E> , provided by the DeciderMapExt extension -
mapLeftOnCommand<
Cn> (C f(Cn)) → Decider< Cn, S, E> -
Available on Decider<
Adapts this decider to accept another command type.C, S, E> , provided by the DeciderMapExt extension -
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