Skip to content

Instantly share code, notes, and snippets.

@glendaviesnz
Last active December 14, 2018 01:41
Show Gist options
  • Save glendaviesnz/27de85cd43d4651928e14367916dc813 to your computer and use it in GitHub Desktop.
Save glendaviesnz/27de85cd43d4651928e14367916dc813 to your computer and use it in GitHub Desktop.
Object literal declaration of component state
const componentStates = {
name: 'userApproval',
states: {
[actionTypes.loadUnapprovedUsers]: {
[ComponentStates.Idle]: { to: ComponentStates.Processing, action: PassthroughAction }
},
[actionTypes.loadUnapprovedUsersSuccess]: {
[ComponentStates.Processing]: { to: ComponentStates.Idle, action: PassthroughAction }
},
[actionTypes.loadUnapprovedUsersError]: {
[ComponentStates.Processing]: { to: ComponentStates.Idle }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment