switchy
0.1.0 • Public • Published
Replace switch
with switchy.
http://chimera.labs.oreilly.com/books/1234000000262/apa.html#dont_use_switch
Install
$ npm install --save switchy
Usage
const switchy = require('switchy')
const chooseFruit = switchy({
apple() {
console.log('apple')
},
peach() {
console.log('peach')
},
default() {
console.log('no idea what you want')
}
})
chooseFruit('apple')
chooseFruit('watermelon')
License
MIT © EGOIST
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads