Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ProfileActions.js
  2.  
  3. import {Actions as LocaleActions} from './locale';
  4. import Dispatcher from '../appDispatcher';
  5.  
  6. //.....
  7.  
  8. export default requestProfile() {
  9.     Dispatcher.dispatch(ActionTypes.PROFILE_REQUEST);
  10.     APIUtils.loadProfile()
  11.         .then(function(profile) {
  12.             const locale = profile.locale;
  13.             Dispatcher.dispatch(ActionTypes.PROFILE_REQUEST_SUCCESS, profile);
  14.             LocaleActions.load(locale);
  15.         })
  16.         .catch(function(err) {
  17.             Dispatcher.dispatch(ActionTypes.PROFILE_REQUEST_FAILED, err);
  18.         });
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement