UNPKG

rx-store-core

Version:

A Rxjs and Immutable based Type-safe state management tool

20 lines (16 loc) 474 B
import { Observer, Subject, Subscription } from "rxjs"; import { AbstractSubjectWithValue } from "./AbstractSubjectWithValue"; export class SubjectWithValue<T> extends AbstractSubjectWithValue< T, Subject<T> > { constructor(public value: T) { super(value, new Subject<T>()); } subscribe(observer: Observer<T>): Subscription { return this.source.subscribe(observer); } asObservable() { return this.source.asObservable(); } }