Subject
Direct Subclass:
Subject is a stream of values, that were pushed into it.
Example:
import { Subject } from 'rxstream';
let stream$ = new Subject();
stream$.subscribe(value => console.log(value));
stream$.next(1); // 1
stream$.next(2); // 2
Constructor Summary
Public Constructor | ||
public |
|
Method Summary
Public Methods | ||
public |
next(data: any) Send value to the stream |
|
public |
subscribe(callback: function): Subscription Subscribe to the stream |
|
public |
subscriptionList(subscriptionList: *): * |
|
public |
unsubscribe(subscription: Subscription) Unsubscribe from the stream |
Public Constructors
public constructor() source
Public Methods
public next(data: any) source
Send value to the stream
Params:
Name | Type | Attribute | Description |
data | any | Any value |
public subscribe(callback: function): Subscription source
Subscribe to the stream
Params:
Name | Type | Attribute | Description |
callback | function |
public subscriptionList(subscriptionList: *): * source
Params:
Name | Type | Attribute | Description |
subscriptionList | * |
Return:
* |
public unsubscribe(subscription: Subscription) source
Unsubscribe from the stream
Params:
Name | Type | Attribute | Description |
subscription | Subscription |