Actyx / machines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow returning void in Reactions

Kelerchian opened this issue · comments

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;
});