looplab / fsm

Finite State Machine for Go
Apache License 2.0
2.86k stars 312 forks source link

add before enter state callback #81

Closed teckick closed 1 year ago

teckick commented 2 years ago

This PR adds a new callback called "before enter state".

It is different from enter state callback, when this callback return an error, the state remains the origin state.

maxekman commented 2 years ago

Is this still something that is needed?

teckick commented 2 years ago

Is this still something that is needed?

@maxekman Thanks for reply! This PR is ready for review.