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

Latest commit

 

History

History
47 lines (38 loc) · 3.9 KB

cp.rx.BehaviorSubject.md

File metadata and controls

47 lines (38 loc) · 3.9 KB

docs » cp.rx.BehaviorSubject


A Subject that tracks its current value. Provides an accessor to retrieve the most recent pushed value, and all subscribers immediately receive the latest value.

API Overview

API Documentation

Methods

Signature cp.rx.BehaviorSubject.create(...) -> cp.rx.BehaviorSubject
Type Method
Description Creates a new BehaviorSubject.
Parameters
  • ... - The initial values.
Returns
  • The new BehaviorSubject.
Signature cp.rx.BehaviorSubject:getValue() -> anything
Type Method
Description Returns the last value emitted by the BehaviorSubject, or the initial value passed to the
Returns
  • The last value.
Signature cp.rx.BehaviorSubject:onNext(...) -> nil
Type Method
Description Pushes zero or more values to the BehaviorSubject. They will be broadcasted to all Observers.
Parameters
  • ... - The values to send.

| Signature | cp.rx.BehaviorSubject:subscribe(observer | onNext, onError, onCompleted) -> cp.rx.Reference | | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Creates a new Observer and attaches it to the BehaviorSubject. Immediately broadcasts the most | | Parameters |

  • observer | onNext - The Observer subscribing, or the function called when the BehaviorSubject produces a value.
  • onError - A function called when the BehaviorSubject terminates due to an error.
  • onCompleted - A function called when the BehaviorSubject completes normally.
| | Returns | |