Created
April 4, 2016 00:13
-
-
Save toranb/8bf0b62841051dc64f1fa81299526a0a to your computer and use it in GitHub Desktop.
classic ember route with the redux service to dispatch with
This file contains 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
import Ember from 'ember'; | |
import ajax from 'example/utilities/ajax'; | |
var UsersRoute = Ember.Route.extend({ | |
redux: Ember.inject.service(), | |
model() { | |
var redux = this.get('redux'); | |
return ajax('/api/users', 'GET').then(response => redux.dispatch({type: 'DESERIALIZE_USERS', response: response})); | |
} | |
}); | |
export default UsersRoute; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment