Skip to content

Instantly share code, notes, and snippets.

@ohager
Created May 15, 2017 16:52
Show Gist options
  • Save ohager/8a9231e910b178a99a9861056108dee9 to your computer and use it in GitHub Desktop.
Save ohager/8a9231e910b178a99a9861056108dee9 to your computer and use it in GitHub Desktop.
UserActionHandler for composition
import UserConstants from "../../constants/UserConstants"
function loadedUserType(payload, stateCursor){
stateCursor.refine(["userTypes"]).data = payload.action.userTypes;
this.emitChange();
}
const UserActionHandler = {
actions: {
[UserConstants.USERTYPE_LOAD_SUCCESS]: loadedUserType,
},
initialState: {
userTypes: []
}
};
export default UserActionHandler;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment