sebpiq / backbone.statemachine

Simple finite-state machine for Backbone. View states made easy. Synchronizing your application's parts with events made easy.
MIT License
177 stars 16 forks source link

[fix] Allow anonymous functions in states declaration hash #26

Closed Fab1en closed 11 years ago

Fab1en commented 11 years ago

Sometimes, when the callbacks are short, it's easier to use anonymous functions :

states: {
    visible: {
        enter: [function() { this.el.show(); }],
        leave: [function() { this.el.hide(); }]
    }
}

This is a proposed fix for issue #25

sebpiq commented 11 years ago

Thanks for the fix!