-
-
Save allanphilipbarku/16907aed6efe89635667f9ccf572cfeb 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([ | |
['guest_1', ()=>{/*do sth*/}], | |
['guest_2', ()=>{/*do sth*/}], | |
['guest_3', ()=>{/*do sth*/}], | |
['guest_4', ()=>{/*do sth*/}], | |
['guest_5', ()=>{/*do sth*/}], | |
['master_1', ()=>{/*do sth*/}], | |
['master_2', ()=>{/*do sth*/}], | |
['master_3', ()=>{/*do sth*/}], | |
['master_4', ()=>{/*do sth*/}], | |
['master_5', ()=>{/*do sth*/}], | |
['default', ()=>{/*do sth*/}], | |
]) | |
const onButtonClick = (identity,status)=>{ | |
let action = actions.get(`${identity}_${status}`) || actions.get('default') | |
action.call(this) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment