Use subscribeLatest from @agoric/notifier/subscribe.js instead.
Adaptor from a notifierP to an async iterable.
The notifierP can be any object that has an eventually invocable
getUpdateSince method that behaves according to the notifier
spec. This can be a notifier, a promise for a local or remote
notifier, or a presence of a remote notifier.
It is also used internally by notifier.js so that a notifier itself is an
async iterable.
An async iterable is an object with a [Symbol.asyncIterator]() method
that returns an async iterator. The async iterator we return here has only
a next() method, without the optional return and throw methods. The
omitted methods, if present, would be used by the for/await/of loop to
inform the iterator of early termination. But this adaptor would not do
anything useful in reaction to this notification.
An async iterator's next() method returns a promise for an iteration
result. An iteration result is a record with value and done properties.
Deprecated
Use
subscribeLatest
from@agoric/notifier/subscribe.js
instead.Adaptor from a notifierP to an async iterable. The notifierP can be any object that has an eventually invocable
getUpdateSince
method that behaves according to the notifier spec. This can be a notifier, a promise for a local or remote notifier, or a presence of a remote notifier.It is also used internally by notifier.js so that a notifier itself is an async iterable.
An async iterable is an object with a
[Symbol.asyncIterator]()
method that returns an async iterator. The async iterator we return here has only anext()
method, without the optionalreturn
andthrow
methods. The omitted methods, if present, would be used by the for/await/of loop to inform the iterator of early termination. But this adaptor would not do anything useful in reaction to this notification.An async iterator's
next()
method returns a promise for an iteration result. An iteration result is a record withvalue
anddone
properties.The purpose of building on the notifier protocol is to have a lossy adaptor, where intermediate results can be missed in favor of more recent results which are therefore less stale. See https://github.com/Agoric/documentation/blob/HEAD/main/guides/js-programming/notifiers.md