Internationalisation
Bundled Plugins API
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
  • onError
  • onNext

API Documentation

Functions

is

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

create

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

onError

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

onNext

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
Last modified 1mo ago