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.

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

  • Given a local or remote subscriber, returns a local AsyncIterable which provides "lossy" iterations of the underlying PublicationList. By "lossy", we mean that you may miss any published state if a more recent published state can be reported instead.

    If the underlying PublicationList is terminated by upgrade of the producer, it will be re-requested. All other terminal values will be losslessly propagated.

    Type Parameters

    • T

    Parameters

    Returns {
        [asyncIterator]: (() => ForkableAsyncIterableIterator<T, T>);
    } & RemotableObject<`Alleged: ${string}`> & RemotableBrand<{}, {
        [asyncIterator]: (() => ForkableAsyncIterableIterator<T, T>);
    }>