We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not use .can if you pass a non-pure or non-idempotent function to the to attribute.
.can
to
The .can function is implemented by invoking the function in the to attribute.
If used, .can would even break the example in the official docs where each to attribute increments the character: https://github.com/jakesgordon/javascript-state-machine/blob/master/docs/states-and-transitions.md#conditional-transitions
seek: function(transition, args) { var wildcard = this.config.defaults.wildcard, entry = this.config.transitionFor(this.state, transition), to = entry && entry.to; if (typeof to === 'function') return to.apply(this.context, args); // BUG HERE. Replace this code with something like return true; else if (to === wildcard) return this.state else return to },
from: https://github.com/jakesgordon/javascript-state-machine/blob/0d603577423244228cebcd62e60dbbfff27c6ea3/src/jsm.js#L55C1-L65C5
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Do not use
.can
if you pass a non-pure or non-idempotent function to theto
attribute.The
.can
function is implemented by invoking the function in the to attribute.If used,
.can
would even break the example in the official docs where each to attribute increments the character: https://github.com/jakesgordon/javascript-state-machine/blob/master/docs/states-and-transitions.md#conditional-transitionsfrom: https://github.com/jakesgordon/javascript-state-machine/blob/0d603577423244228cebcd62e60dbbfff27c6ea3/src/jsm.js#L55C1-L65C5
The text was updated successfully, but these errors were encountered: