git ssb

1+

Matt McKegg / mutant



Tree: a1abe9b483bc5d56548a660d97c1e2290a176d19

Files: a1abe9b483bc5d56548a660d97c1e2290a176d19 / when.js

232 bytesRaw
1var computed = require('./computed')
2
3module.exports = When
4
5function When (obs, ifTrue, ifFalse) {
6 return computed([obs, ifTrue, ifFalse], lambda)
7}
8
9function lambda (value, ifTrue, ifFalse) {
10 return value ? ifTrue : ifFalse
11}
12

Built with git-ssb-web