Files: 955ee4ba0914a6c2c9a1158bdfa7ea7a186ca900 / watch.js
268 bytesRaw
1 | module.exports = watch |
2 | |
3 | function watch (observable, listener) { |
4 | if (typeof observable === 'function') { |
5 | var remove = observable(listener) |
6 | listener(observable()) |
7 | return remove |
8 | } else { |
9 | listener(observable) |
10 | return noop |
11 | } |
12 | } |
13 | |
14 | function noop () {} |
15 |
Built with git-ssb-web