An open API service indexing awesome lists of open source software.

https://github.com/huanghaiyang/whenable

case when then else
https://github.com/huanghaiyang/whenable

Last synced: 5 months ago
JSON representation

case when then else

Awesome Lists containing this project

README

        

# whenable
case when then else

## no if else



when(true)
.then(() => console.log('the condition is true'))
.else(() => console.log('the condition is false'))

or



when(() => true)
.then(() => console.log('the condition is true'))
.else(() => console.log('the condition is false'))

or



when(() => {
return new Promise((resolve, reject) => {
resolve(true)
})
})
.then(() => console.log('the condition is true'))
.else(() => console.log('the condition is false'))