Skip to content

Instantly share code, notes, and snippets.

@rbiggs
Last active October 25, 2019 03:08
Show Gist options
  • Select an option

  • Save rbiggs/b452625ff13de9bf36629be61f472539 to your computer and use it in GitHub Desktop.

Select an option

Save rbiggs/b452625ff13de9bf36629be61f472539 to your computer and use it in GitHub Desktop.
Actions for the program's update method
// actions gets two arguments: state and the message we send
function actions(state, message) {
switch(message) {
case 'updateInputValue':
// Update state with new value:
state.inputValue = message.value
// Don't forget to return state:
return state
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment