Files: 1964140bd2d8f29be42fb1ff7af768d7fb89ef59 / when.js
232 bytesRaw
1 | var computed = require('./computed') |
2 | |
3 | module.exports = When |
4 | |
5 | function When (obs, ifTrue, ifFalse) { |
6 | return computed([obs, ifTrue, ifFalse], lambda) |
7 | } |
8 | |
9 | function lambda (value, ifTrue, ifFalse) { |
10 | return value ? ifTrue : ifFalse |
11 | } |
12 |
Built with git-ssb-web