(update) added event argument hitchhiking#1
Open
Zukzuk wants to merge 9 commits intowheeyls:masterfrom
Zukzuk:feature/on-enter-event-args
Open
(update) added event argument hitchhiking#1Zukzuk wants to merge 9 commits intowheeyls:masterfrom Zukzuk:feature/on-enter-event-args
Zukzuk wants to merge 9 commits intowheeyls:masterfrom
Zukzuk:feature/on-enter-event-args
Conversation
added 9 commits
March 22, 2016 13:39
Owner
|
Lol it's absurd how long ago you submitted this, and I just saw it now. Gonna have to ask Github to work out their notifications, I'm on this site every day. |
wheeyls
requested changes
Feb 10, 2017
| states[name] = states[name] || function () { | ||
| states.trigger(name); | ||
| var args = Array.prototype.slice.call(arguments); | ||
| var arr = args.sort(); |
Owner
There was a problem hiding this comment.
Why this sort call? This is really unexpected in my experience, I'd expect the order or arguments to never change?
| me.onChange(me.currentState(), prev.name); | ||
| is(currentState.enter, 'Function') && currentState.enter(); | ||
| me.onChange(me.currentState(), prev.name, args); | ||
| args.push(me.currentState()); |
Owner
There was a problem hiding this comment.
Why put the current state at the end of the list of arguments? Wouldn't it be more predictable to have the current state as the first argument?
| ; | ||
|
|
||
| newStates.withParams('a string', {some: 'data'}); | ||
| q.equal(_in1, 'a string'); |
Owner
There was a problem hiding this comment.
These specs are failing for me: https://cl.ly/2C283C1l1w2y
Owner
|
Curious if you're using these changes in production anywhere? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For this fine state machine to be compatible with our envisioned payment workflow implementation, I need to be able to update our database inside the stateMachine itself. With this change we can add arguments to the event method and use them in the enter phase of the state change. See test for implementation