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