prime31/StateKit

Update readme: machine.reason() not reachable

Closed this issue · 1 comments

First - thanks for an excellent and simple open source FSM!

machine.reason() does not seem to be a valid call anymore, it seems that reason() is called in update() in the current version. If this is intentionally the readme on github should be updated.

Is there any particular reason why reason() is now automatically called in the update() function ?
I have a case where I need to call reason() after update(), and I was just wondering why these are bundled together as it seems they were originally separated.

Updated the README. reason was added to update since it is the most common way to use the States as Objects pattern so it made sense to call it automatically. Note that you are of course free to just move the reason call to after update internally.