Is there a hook middleware or some other place where I can detect a State transition and execute code? Want to be able to detect fromState and toState
My idea right now is to do a hook on the before.response middleware and store the current state in a session variable: jovo.$session.$data.MYSTATE. If this value and jovo.getState() are different, then I know a state change has occurred. The fromState would be MYSTATE and the toState would be the value from getState. I could do conditionals to check for specific transitions and execute code.
Is there a better approach?
What is the earliest standard, before or after middleware that I can plug into for this?
@AlexSwe Any recommendations?