Internationalisation
Bundled Plugins API
Subject
Subjects function both as an Observer and as an Observable. Subjects inherit all Observable functions, including subscribe. Values can also be pushed to the Subject, which will be broadcasted to any subscribed Observers.

API Overview

API Documentation

Methods

Signature
cp.rx.Subject:onCompleted() -> nil
Type
Method
Description
Signal to all Observers that the Subject will not produce any more values.

onError

Signature
cp.rx.Subject:onError(message) -> nil
Type
Method
Description
Signal to all Observers that an error has occurred.
Parameters
  • message - A string describing what went wrong.

onNext

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

subscribe

Signature
cp.rx.Subject:subscribe(onNext[, onError[, onCompleted]]) -> cp.rx.Reference
Type
Method
Description
Creates a new Observer and attaches it to the Subject.
Parameters
  • observer
Returns
Last modified 1mo ago
Export as PDF
Copy link