#cp.rx.Observer

Observers are simple objects that receive values from Observables.


#API Overview

Functions - API calls offered directly by the extension

Constructors - API calls which return an object, typically one that offers API methods

Methods - API calls which can only be made on an object returned by a constructor


#API Documentation

#Functions

Signaturecp.rx.Observer.is(thing) -> boolean
TypeFunction
DescriptionTests if the thing is an Observer.
Parameters
  • thing - The thing to test.
Returns
  • true if the thing is an Observer, otherwise false.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/rx/Observer.lua line 14

#Constructors

Signaturecp.rx.Observer.create(onNext, onError, onCompleted) -> cp.rx.Observer
TypeConstructor
DescriptionCreates 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.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/rx/Observer.lua line 27

#Methods

Signaturecp.rx.Observer:onCompleted() -> nil
TypeMethod
DescriptionNotify the Observer that the sequence has completed and will produce no more values.
Parameters
  • None
Returns
  • Nothing
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/rx/Observer.lua line 80

Signaturecp.rx.Observer:onError(message) -> nil
TypeMethod
DescriptionNotify the Observer that an error has occurred.
Parameters
  • message - A string describing what went wrong.
Returns
  • Nothing
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/rx/Observer.lua line 64

Signaturecp.rx.Observer:onNext(...) -> nil
TypeMethod
DescriptionPushes zero or more values to the Observer.
Parameters
  • ... - The list of values to send.
Returns
  • Nothing
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/rx/Observer.lua line 49