import {BehaviorSubject, Observable} from "rxjs"; export class SubscribeService { private loading: BehaviorSubject = new BehaviorSubject(false); private members: BehaviorSubject = new BehaviorSubject(0); public setLoading(loading: boolean) { this.loading.next(loading); } public setMembers(members: number) { this.members.next(members); } public getLoading(): Observable { return this.loading.asObservable(); } public getMembers(): Observable { return this.members.asObservable(); } }