matthewp / robot

🤖 A functional, immutable Finite State Machine library

Home Page:https://thisrobot.life

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass the event into the initial context

matthewp opened this issue · comments

This is particularly useful for child machines. Prevents the need for an initial state to handle receiving the event.

const child = createMachine({
  one: state()
}, (ctx, ev) => ( { files: ev.files }));

This was added.