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.
- Methods - API calls which can only be made on an object returned by a constructor
- onCompleted
- onError
- onNext
- subscribe
| 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 |
|
| 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 |
|
| 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 |
|
| Returns |
|