I was wondering if we could achieve something like this:
search_state: {
on: {
GO_BACK: (previousState) => {
if(previousState === 'initial_state'){
return 'initial_state'
}
return "manual_search_state";
},
},
}
Basically, i want to dynamically go to the new state based on certain conditions. But right now, the handler is not allowed in the definition, it just accepts string.