-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
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
documentation for StateManager #682
Conversation
Looks pretty good, though I'm not the expert on States. However, from what I understand, you really should only call |
Excellent, just the sort of discussion I was hoping for. I've seen state actions mentioned several times, and always with the admonishment to always/only call them from "within a state". Sadly nobody ever provides an example of usage. I have an inkling of what they're getting – or at least suspect I do. |
@trek Thanks for getting this discussion going! I think it the scenario would look something like this: Two states: |
That seems to be the go-to example, but nobody mentions where to make the call to the action. The presence of stateManager.send and parts of ActionHelper imply you'd call the
|
@trek The code you have above is my understanding of the recommended way to do it. |
Terrific write up of Ember’s StateManager and a nice introduction to State Machines generally. |
…ns connected to views via the {{action}} helper.
<h2>Photos</h2> | ||
</div> | ||
</body> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should really be dashboard.get('navigationAreaView'), in case that property ever becomes watched for whatever reason.
Thanks Trek. @wagenet nailed our current feelings on how states should be built--dispatch events using The other nit-pick I had was that there a few places where you're not using the |
Yow, delicious information! Trek, thank you for such wonderful docs. (And thank you emberjs for such a juicy state machine.) |
@tomdale are you talking about just the calls to |
@trek Yep, I'd change the state name stuff to |
|
||
<body> | ||
<script type='text/x-handlebars'> | ||
<a href="#" {{action "anAction" target="App.appStates"}}> Go </a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the the target here should be App.states
not App.appStates
? If not then can you add a bit explaining how appStates translates to the App.states
property below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, it's just a typo.
Gonna merge this in. @trek, if you have any more changes, please submit a new PR. Thanks! |
documentation for StateManager
…rn/ember-data-3.22.0 Bump ember-data from 3.21.2 to 3.22.0
No description provided.