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

Latest commit

 

History

History
46 lines (37 loc) · 3.73 KB

File metadata and controls

46 lines (37 loc) · 3.73 KB

docs » cp.rx.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.
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.
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.
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