Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can exit #2

Merged
merged 4 commits into from
Sep 9, 2014
Merged

Can exit #2

merged 4 commits into from
Sep 9, 2014

Conversation

DouglasMeyer
Copy link
Contributor

Allow states to conditionally prevent exiting with canExit.

// returns false, no state transition occurs.
//
// Returns the receiver.
canExit: function pState_canExit(f) { this.canExits.push(f); return this; },
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DouglasMeyer Can you think of a valid use case for multiple canExit handlers on a state? I'm thinking it would be easier to just implement a default canExit method that returns true that could be overridden by states that want to block exits.

@DouglasMeyer
Copy link
Contributor Author

@burrows All green!

@DouglasMeyer
Copy link
Contributor Author

@burrows hold off, there may still be an issue.

@DouglasMeyer
Copy link
Contributor Author

@burrows Ok, all good

@burrows
Copy link
Owner

burrows commented Sep 9, 2014

@DouglasMeyer Nice work, merging!

burrows added a commit that referenced this pull request Sep 9, 2014
@burrows burrows merged commit 943d7d1 into burrows:master Sep 9, 2014
@DouglasMeyer DouglasMeyer deleted the can_exit branch September 10, 2014 13:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants