observables notify a "spectate" event whenever their value changes. #2171

Merged
merged 2 commits into from Dec 14, 2016

Projects

None yet

2 participants

@mbest
Member
mbest commented Dec 10, 2016

This is like the "change" event but is not delayed by rateLimit/deferred and will notify when a sleeping pure computed observable gets a new value (by being accessed). Subscribing to "spectate" will not awaken a sleeping pure computed either.

See #1735 and #1511

@mbest mbest observables notify a "spectate" event whenever their value changes. T…
…his is like the "change" event but is not delayed by rateLimit/deferred and will notify when a sleeping pure computed observable gets a new value (by being accessed). Subscribing to "spectate" will not awaken a sleeping pure computed either.
4296eed
@mbest mbest added this to the 3.5.0 milestone Dec 10, 2016
@mbest mbest requested a review from brianmhunt Dec 10, 2016
@mbest
Member
mbest commented Dec 11, 2016

spectate occurs before change. For a rate-limited or deferred computed, the spectate event doesn't cause the computed value to be calculated early. Instead it will be fired right before the delayed change event, or if the computed is accessed earlier, it will be fired then.

@brianmhunt

It looks good to me (though I haven't run the unit tests.) Thanks, @mbest .

@mbest mbest Expand pureComputed spectate test to show why the version needs to be…
… updated before the spectate event.
4e55d4b
@mbest mbest merged commit 87e8a59 into master Dec 14, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@brianmhunt
Member

@mbest - Glad you added 4e55d4b – makes the changes to updateVersion easier to understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment