Skip to content

Instantly share code, notes, and snippets.

@bitfishxyz
Created January 20, 2020 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bitfishxyz/d21769e4ce3fbfc5bbfa0d112c27b1c3 to your computer and use it in GitHub Desktop.
Save bitfishxyz/d21769e4ce3fbfc5bbfa0d112c27b1c3 to your computer and use it in GitHub Desktop.
const actions = new Map([
[1, ['processing','IndexPage']],
[2, ['fail','FailPage']],
[3, ['fail','FailPage']],
[4, ['success','SuccessPage']],
[5, ['cancel','CancelPage']],
['default', ['other','Index']]
])
const onButtonClick = (status)=>{
let action = actions.get(status) || actions.get('default')
sendLog(action[0])
jumpTo(action[1])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment