Skip to content

Commit

Permalink
update logs shareservice
Browse files Browse the repository at this point in the history
  • Loading branch information
Janith Rathnayaka committed Nov 28, 2024
1 parent 4cfc70a commit 4fe8eb0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/publisher/src/shared/shared.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { shareReplay, switchMap, take, tap } from "rxjs/operators";
@Injectable()
export class SharedService{
private _reportId: Subject<string> = new Subject<string>();
reportId$: Observable<string> = this._reportId.asObservable().pipe(take(1), shareReplay(1));
reportId$: Observable<string> = this._reportId.asObservable().pipe(
take(1),
tap(value => console.log('Report ID emitted:', value)),
shareReplay(1)
);

private _wpPost: Subject<any> = new Subject<any>();
wpPost$: Observable<string> = this._wpPost.asObservable().pipe(take(1), shareReplay(1));
Expand All @@ -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){
Expand Down

0 comments on commit 4fe8eb0

Please sign in to comment.