Skip to content

Instantly share code, notes, and snippets.

@allanphilipbarku
Forked from bitfishxyz/map.js
Created February 12, 2020 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allanphilipbarku/d5e41f17f504a14e49ebd908ca959f46 to your computer and use it in GitHub Desktop.
Save allanphilipbarku/d5e41f17f504a14e49ebd908ca959f46 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