Commit b645b2baf1b153c97d7f9d13ee6b47556d710d1c
computed, map: onListen will now run a function if returned when unlistening
Matt McKegg committed on 9/20/2016, 6:52:46 AMParent: bd426f70b20582a00fe0bfa9e1fca8d3d28f0acc
Files changed
computed.js | changed |
map.js | changed |
computed.js | ||
---|---|---|
@@ -83,9 +83,12 @@ | ||
83 | 83 | this.live = true |
84 | 84 | this.lazy = true |
85 | 85 | |
86 | 86 | if (this.opts && this.opts.onListen) { |
87 | - this.opts.onListen() | |
87 | + var release = this.opts.onListen() | |
88 | + if (typeof release === 'function') { | |
89 | + this.releases.push(release) | |
90 | + } | |
88 | 91 | } |
89 | 92 | } |
90 | 93 | }, |
91 | 94 | unlisten: function () { |
Built with git-ssb-web