Created
January 20, 2020 11:27
-
-
Save bitfishxyz/d21769e4ce3fbfc5bbfa0d112c27b1c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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