Observable API
The next() method of the Subscriber interface sends a value to each observer of the subscription, invoking its next callback synchronously. These callbacks are supplied to Observable.subscribe().
Syntax
next(value)
Parameters
value- : The value to send to observers. This can be any JavaScript value.
Return value
None (undefined).
Description
If the subscriber is no longer Subscriber.active, this method does nothing. An exception thrown by an observer's next callback is reported to the global object; it does not call that observer's error callback or stop delivery to other observers.
[!NOTE] This shared-subscription behavior may change. A proposal to give each observer its own
Subscriberwould make each subscription start a separate execution instead of reusing an active subscription.
Examples
See the main Subscriber reference page for a basic example, and Creating custom observables for additional examples.
Specifications
Browser compatibility
See also
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
