Subject
A Subject is a special type of Observable that allows values to be multicasted to many Observers. Subjects are like EventEmitters.
Every Subject is an Observable and an Observer. You can subscribe to a Subject, and you can call next to feed values as well as error and complete.
class Subject<T> extends Observable<T> implements SubscriptionLike { }
constructor();
private currentObservers;
closed: boolean;
hasError: boolean;
isStopped: boolean;
get observed(): boolean;
observers: Observer<T>[];
thrownError: any;
asObservable(): Observable<T>;
complete(): void;
error(err: any): void;
next(value: T): void;
unsubscribe(): void;
static create: (...args: any[]) => any;
§Implements
§Properties
§Methods
§
asObservable(): Observable<T>
[src]Creates a new Observable with this Subject as the source. You can do this to create custom Observer-side logic of the Subject and conceal it from code that uses the Observable.
@return
Observable that the Subject casts to