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

Latest commit

 

History

History
63 lines (51 loc) · 4.45 KB

cp.rx.Observer.md

File metadata and controls

63 lines (51 loc) · 4.45 KB

docs » cp.rx.Observer


Observers are simple objects that receive values from Observables.

API Overview

  • Functions - API calls offered directly by the extension
  • is
  • 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

API Documentation

Functions

Signature cp.rx.Observer.is(thing) -> boolean
Type Function
Description Tests if the thing is an Observer.
Parameters
  • thing - The thing to test.
Returns
  • true if the thing is an Observer, otherwise false.

Constructors

Signature cp.rx.Observer.create(onNext, onError, onCompleted) -> cp.rx.Observer
Type Constructor
Description Creates a new Observer.
Parameters
  • onNext - Called when the Observable produces a value.
  • onError - Called when the Observable terminates due to an error.
  • onCompleted - Called when the Observable completes normally.
Returns
  • The new Observer.

Methods

Signature cp.rx.Observer:onCompleted() -> nil
Type Method
Description Notify the Observer that the sequence has completed and will produce no more values.
Parameters
  • None
Returns
  • Nothing
Signature cp.rx.Observer:onError(message) -> nil
Type Method
Description Notify the Observer that an error has occurred.
Parameters
  • message - A string describing what went wrong.
Returns
  • Nothing
Signature cp.rx.Observer:onNext(...) -> nil
Type Method
Description Pushes zero or more values to the Observer.
Parameters
  • ... - The list of values to send.
Returns
  • Nothing