qmuntal / stateless

Go library for creating finite state machines
BSD 2-Clause "Simplified" License
898 stars 47 forks source link

Extended state [WIP] #55

Closed kunalpowar closed 1 year ago

kunalpowar commented 1 year ago

This PR introduces extended state derived from UML spec. The idea is to have an extended state of dynamic type passed when creating a state machine. The extended should be available to all state actions (ex: exit, entry etc), transitions and guards.

Check the diff in example_test.go to see an example of passing volume as an extended state of the phone and mutating the same.

kunalpowar commented 1 year ago

Closed since this solution works for extended states.