Closed
Description
Why can't I use the event handler by itself without adding a route? Shouldn't this be a design decision up to the client programmer?
machine.addEventHandler(.GotoPreviousCard, handler: { (event, transition, order, userInfo) -> Void in
println("FeedView ! GotoPreviousCard")
})
Instead, I have to add a route that messes everything up. Sure, I can make it work but it's pretty pointless when I don't want to change states and instead I have code firing twice I would rather not be.
I would like my view to react to events without making state changes. If anything, I would rather filter events for certain states. For example, if someone "likes" a picture, you might send a Like
event during the ShowingPhoto
state. Your library could make the validation and what not.
In lieu of this functionality, I made transitions with nil => nil