forked from oxplot/fysom
-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Just a thought, is it worth providing some integration into signalslot so the events generated by the state machine are exported to other objects as "signals"? I've been managing this by hand in my own code, and found it a very powerful way to interact with Fysom.
It could be an optional feature turned on by specifying what events you want signals created for in the constructor. e.g.
fsm = Fysom({ 'initial': 'green',
'events': [
{'name': 'warn', 'src': 'green', 'dst': 'yellow'},
{'name': 'panic', 'src': 'yellow', 'dst': 'red'},
{'name': 'calm', 'src': 'red', 'dst': 'yellow'},
{'name': 'clear', 'src': 'yellow', 'dst': 'green'} ],
'signals': ['onentergreen','onenteryellow','onenterred', ...]})
The signals could be properties with _sig appended to the name to avoid confusion.
signalslot is here: https://github.com/Numergy/signalslot
If there's interest I might look into implementing it proper.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels