git ssb

1+

Matt McKegg / mutant



Commit 52a53f6c954527bd2ff1b45d18bbf6679ef83038

computed: handle getValue + broadcast race condition

Matt McKegg committed on 6/13/2017, 4:03:59 AM
Parent: c1ba2ca52c5a8cef2a00e9913a89756d8d337667

Files changed

computed.jschanged
computed.jsView
@@ -184,14 +184,17 @@
184184 this.broadcast()
185185 }
186186 },
187187 getValue: function () {
188 + var wasLazy = this.live && this.lazy
188189 if (!this.live || this.lazy || this.updating) {
189190 this.lazy = false
190191 if (this.opts && this.opts.nextTick && this.live && this.lazy) {
191192 this.onUpdate() // use cached value to make more responsive
192193 } else {
193- this.update()
194 + if (this.update() && wasLazy) {
195 + this.broadcast()
196 + }
194197 }
195198 if (this.inner) {
196199 this.outputValue = resolve(this.inner)
197200 }

Built with git-ssb-web