IDecider represents the main decision-making algorithm.
It has three generic parameters C, S, E , representing the type of the values that IDecider may contain or use.
IDecider can be specialized for any type C or S or E because these types does not affect its behavior.
IDecider behaves the same for C=Int or C=YourCustomType, for example.
IDecider is a pure domain interface.
Param: decide
A function/lambda that takes command of type C and input state of type S as parameters, and returns/emits the list of output events E[]>
Param: evolve
A function/lambda that takes input state of type S and input event of type E as parameters, and returns the output/new state S
IDecider
represents the main decision-making algorithm. It has three generic parametersC
,S
,E
, representing the type of the values thatIDecider
may contain or use.IDecider
can be specialized for any typeC
orS
orE
because these types does not affect its behavior.IDecider
behaves the same forC
=Int
orC
=YourCustomType
, for example.IDecider
is a pure domain interface.Param: decide
A function/lambda that takes command of type
C
and input state of typeS
as parameters, and returns/emits the list of output eventsE[]
>Param: evolve
A function/lambda that takes input state of type
S
and input event of typeE
as parameters, and returns the output/new stateS
Param: initialState
A starting point / An initial state of type
S
Author
Иван Дугалић / Ivan Dugalic /
Idugalic