import { Injectable } from '@angular/core'; import { BehaviorSubject, Subject } from 'rxjs'; import { IClient } from '../interfaces/IResult'; @Injectable({ providedIn: 'root', }) export class ComunicationComponentsService { private _client = new BehaviorSubject(''); private _dbouncer = new BehaviorSubject(''); private _dbouncerClients = new BehaviorSubject(''); private _dbUpdateProfile = new BehaviorSubject(undefined); private _deletedPageId = new Subject(); private _navigationId = new BehaviorSubject(''); private _pageUrl = new Subject(); private _statusSbj = new BehaviorSubject(''); private _styleSbj = new Subject(); private _userPass = new Subject(); changeStyle(style: string) { this._styleSbj.next(style); } onChangeStyle() { return this._styleSbj.asObservable(); } searchStatus(status: string) { this._statusSbj.next(status); } onSearchStatus() { return this._statusSbj.asObservable(); } searchDbouncer(value: string) { this._dbouncer.next(value); } onDbouncer() { return this._dbouncer.asObservable(); } searchDbouncerClients(value: string) { this._dbouncerClients.next(value); } onDbouncerClients() { return this._dbouncerClients.asObservable(); } getClient(client: any) { this._client.next(client); } onClient() { return this._client.asObservable(); } detectUpdate(profile: any) { this._dbUpdateProfile.next(profile); } onUpdateProfile() { return this._dbUpdateProfile.asObservable(); } sendPageUrl(pageId: string) { this._pageUrl.next(pageId); } onSendPageUrl() { return this._pageUrl.asObservable(); } sendNavigation(navigationId: any) { this._navigationId.next(navigationId); } onSendNavigation() { return this._navigationId.asObservable(); } sendUser(user: any) { this._userPass.next(user); } onSendUser() { return this._userPass.asObservable(); } deleteLastPage() { this._deletedPageId.next(undefined); } onDeleteLastPage() { return this._deletedPageId.asObservable(); } }