Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Latest commit

 

History

History
59 lines (48 loc) · 4.66 KB

cp.rx.AsyncSubject.md

File metadata and controls

59 lines (48 loc) · 4.66 KB

docs » cp.rx.AsyncSubject


AsyncSubjects are subjects that produce either no values or a single value. If multiple values are produced via onNext, only the last one is used. If onError is called, then no value is produced and onError is called on any subscribed Observers. If an Observer subscribes and the AsyncSubject has already terminated, the Observer will immediately receive the value or the error.

API Overview

  • Constructors - API calls which return an object, typically one that offers API methods
  • create
  • Methods - API calls which can only be made on an object returned by a constructor
  • onCompleted
  • onError
  • onNext
  • subscribe

API Documentation

Constructors

Signature cp.rx.AsyncSubject.create() -> cp.rx.AsyncSubject
Type Constructor
Description Creates a new AsyncSubject.
Returns
  • The new AsyncSubject.

Methods

Signature cp.rx.AsyncSubject:onCompleted() -> nil
Type Method
Description Signal to all Observers that the AsyncSubject will not produce any more values.
Signature cp.rx.AsyncSubject:onError(message) -> nil
Type Method
Description Signal to all Observers that an error has occurred.
Parameters
  • message - A string describing what went wrong.
Signature cp.rx.AsyncSubject:onNext(...) -> nil
Type Method
Description Pushes zero or more values to the AsyncSubject.
Parameters
  • ... - The values to send.
Signature cp.rx.AsyncSubject:subscribe(onNext, onError, onCompleted) -> cp.rx.Reference
Type Method
Description Creates a new Observer and attaches it to the AsyncSubject.
Parameters
  • onNext
Returns