ReactKit / SwiftState

Elegant state machine for Swift.
MIT License
904 stars 93 forks source link

Add `addAnyHandler()`. #41

Closed inamiy closed 8 years ago

inamiy commented 8 years ago

This pull request is a new feature for #40 to support addAnyHandler() which works for both event-based & state-based transitions.

See test case: StateMachineEventTests.swift#L382-L446

sluramod commented 8 years ago

I expected transition to be input parameter of the method, and the handler called only when the transition happened, but regardless of how.

inamiy commented 8 years ago

@sluramod Thanks for feedback! That sounds even better, and I updated code in 1e88704. Please see updated test case.

sluramod commented 8 years ago

excellent, thank you.

inamiy commented 8 years ago

Ready to :shipit: