Internationalisation
Bundled Plugins API
RelaySubject
A Subject that provides new Observers with some or all of the most recently produced values upon reference.

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
  • onNext
  • subscribe

API Documentation

Constructors

create

Signature
cp.rx.RelaySubject.create([n]) -> cp.rx.RelaySubject
Type
Constructor
Description
Creates a new ReplaySubject.
Parameters
  • bufferSize - The number of values to send to new subscribers. If nil, an infinite buffer is used (note that this could lead to memory issues).
Returns
  • The new `ReplaySubject.

Methods

onNext

Signature
cp.rx.RelaySubject:onNext(...) -> nil
Type
Method
Description
Pushes zero or more values to the ReplaySubject. They will be broadcasted to all Observers.
Parameters
  • ... - The values to send.

subscribe

| Signature | cp.rx.RelaySubject:subscribe([observer | onNext[, onError[, onCompleted]]]) -> cp.rx.Reference | | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Creates a new Observer and attaches it to the ReplaySubject. | | Parameters |
  • observer | onNext - Either an Observer, or a function to call when the ReplaySubject produces a value.
  • onError - A function to call when the ReplaySubject terminates due to an error.
  • onCompleted - A function to call when the ReplaySubject completes normally.
| | Returns |
|
Last modified 1mo ago