Open phillipskevin opened 6 years ago
An AsyncObservable cannot return a value from its getter if resolve has already been called.
resolve
That means the observable below cannot be used to toggle from 0 to 1 and then back to 0:
0
1
var asyncObs = new AsyncObservable(function(lastSet, resolve){ if (value.get() === 1) { resolve(1); } return 0; });
Maybe what is strange about this is that the value ever becomes 1, since even when you resolve(1) you also then return 0.
resolve(1)
An AsyncObservable cannot return a value from its getter if
resolve
has already been called.That means the observable below cannot be used to toggle from
0
to1
and then back to0
: