Skip to content

Instantly share code, notes, and snippets.

@chengsokdara
Last active November 11, 2019 16:33
Show Gist options
  • Save chengsokdara/85859717b476d66ec7a5dfc75053d109 to your computer and use it in GitHub Desktop.
Save chengsokdara/85859717b476d66ec7a5dfc75053d109 to your computer and use it in GitHub Desktop.
StoRa config sample
export default {
// This will be where you initialize your states
states: {
testScreen: {
testState: 'testState'
},
demoScreen: {
demoState: 'demoState'
}
},
// This will be where you initialize your actions
actions: {
testScreen: {
testAction: stora => {
console.log('stora', stora)
}
},
demoScreen: {
demoAction: ({ states, actions }, demoBoolean) => {
console.log('states', states, 'actions', actions)
console.log('demoBoolean', demoBoolean)
}
}
},
// If you need to do something before global state initialization
init: stora => {
console.log('stora', stora)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment