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 event type to reduce

jamesopstad opened this issue · comments

Thanks for the great library. An issue I'm having using it in Typescript is that the event type in ReduceFunction is always unknown. What do think about adding an additional type argument so that the event type can be set as well as the context type? I think it makes sense to also add this to ContextFunction, GuardFunction, ActionFunction and transition.

Yep! I don't do much typescript, but will happily accept a PR to change the typings file.