Skip to content

Instantly share code, notes, and snippets.

@bitfishxyz
Created January 20, 2020 11:10
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/093cf525e0fffa2ae9c165709f053a3d to your computer and use it in GitHub Desktop.
Save bitfishxyz/093cf525e0fffa2ae9c165709f053a3d to your computer and use it in GitHub Desktop.
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