-
Notifications
You must be signed in to change notification settings - Fork 30
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
API idea. #28
Comments
@stefanpenner I agree with auto-generating the state service or at least doing something behind the scenes so that it is hidden from the users point of view. How would the user get |
import |
If you simply import stateFor how would it get access to the container? I assume you are talking about something like this: // state-for.js
export default function(stateName, options) {
// get state from container
// or simply keep a 'dumb' hashMap here and just reference it instead???
return state
};
// my-cool-component.js
import Ember from 'ember';
import stateFor from 'path/to/state-for';
export default Ember.Component.extend({
state: stateFor('email', { key: 'email' }),
}); |
@thoov the same way CP's work. (it would just be a type of CP) |
Ok let me whip something up |
👍 |
Nice work @thoov. Docs need to be updated to reflect the PR 👍 |
@jasonmit ya I am sending another PR with an updated example and I will be updating the readme |
rather then inject + cp
it would be nice to do.
in most cases we can likely auto-generate the state service itself, only making the state objects something the user needs to deal with.
cc @thoov
The text was updated successfully, but these errors were encountered: