Commit 52a53f6c954527bd2ff1b45d18bbf6679ef83038
computed: handle getValue + broadcast race condition
Matt McKegg committed on 6/13/2017, 4:03:59 AMParent: c1ba2ca52c5a8cef2a00e9913a89756d8d337667
Files changed
computed.js | changed |
computed.js | |||
---|---|---|---|
@@ -184,14 +184,17 @@ | |||
184 | 184 … | this.broadcast() | |
185 | 185 … | } | |
186 | 186 … | }, | |
187 | 187 … | getValue: function () { | |
188 … | + var wasLazy = this.live && this.lazy | ||
188 | 189 … | if (!this.live || this.lazy || this.updating) { | |
189 | 190 … | this.lazy = false | |
190 | 191 … | if (this.opts && this.opts.nextTick && this.live && this.lazy) { | |
191 | 192 … | this.onUpdate() // use cached value to make more responsive | |
192 | 193 … | } else { | |
193 | - this.update() | ||
194 … | + if (this.update() && wasLazy) { | ||
195 … | + this.broadcast() | ||
196 … | + } | ||
194 | 197 … | } | |
195 | 198 … | if (this.inner) { | |
196 | 199 … | this.outputValue = resolve(this.inner) | |
197 | 200 … | } |
Built with git-ssb-web