Allow returning void in Reactions
Kelerchian opened this issue · comments
Alan Darmasaputra commented
Expected
Returning void as non-transitioning reaction is allowed when Self.State is supplied as the next state
State.react([EventA, EventB], State, (ctx, eventA, eventB) => {
ctx.self.field = getSomeValue();
});
Actual
Retruning void is not allowed, self must be returned when Self.State is supplied as the next state
State.react([EventA, EventB], State, (ctx, eventA, eventB) => {
ctx.self.field = getSomeValue();
return ctx.self;
});