Ecosyste.ms: Awesome
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: 6 days ago
JSON representation
case when then else
- Host: GitHub
- URL: https://github.com/huanghaiyang/whenable
- Owner: huanghaiyang
- License: mit
- Created: 2019-11-23T06:10:29.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T01:30:42.000Z (almost 2 years ago)
- Last Synced: 2024-10-13T17:38:51.531Z (about 1 month ago)
- Language: JavaScript
- Size: 350 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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'))