From 4fe8eb076c512474c98ddea1166c6d52037b66b9 Mon Sep 17 00:00:00 2001 From: Janith Rathnayaka Date: Thu, 28 Nov 2024 16:34:20 +0530 Subject: [PATCH] update logs shareservice --- apps/publisher/src/shared/shared.service.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/publisher/src/shared/shared.service.ts b/apps/publisher/src/shared/shared.service.ts index 783f8b00..9acee9fe 100644 --- a/apps/publisher/src/shared/shared.service.ts +++ b/apps/publisher/src/shared/shared.service.ts @@ -6,7 +6,11 @@ import { shareReplay, switchMap, take, tap } from "rxjs/operators"; @Injectable() export class SharedService{ private _reportId: Subject = new Subject(); - reportId$: Observable = this._reportId.asObservable().pipe(take(1), shareReplay(1)); + reportId$: Observable = this._reportId.asObservable().pipe( + take(1), + tap(value => console.log('Report ID emitted:', value)), + shareReplay(1) + ); private _wpPost: Subject = new Subject(); wpPost$: Observable = this._wpPost.asObservable().pipe(take(1), shareReplay(1)); @@ -30,7 +34,10 @@ export class SharedService{ updateReportId(id: string){ console.log('updateReportId', id) - this._reportId.next(id); + this._reportId.next(id); + this._reportId.subscribe((id: string) => { + console.log(`Report ID updated: ${id}`); + }); } updateWpPost(wpPost: any){