Browse Source

returning observable instead of subject

pull/17054/head
Sinan997 3 years ago
committed by Mahmut Gundogdu
parent
commit
98f9f2be06
  1. 4
      npm/ng-packs/packages/core/src/lib/services/internet-connection-service.ts

4
npm/ng-packs/packages/core/src/lib/services/internet-connection-service.ts

@ -9,7 +9,7 @@ export class InternetConnectionService{
protected readonly window = inject(DOCUMENT).defaultView; protected readonly window = inject(DOCUMENT).defaultView;
protected readonly navigator = this.window.navigator; protected readonly navigator = this.window.navigator;
/* observable */ /* BehaviorSubject */
private status$ = new BehaviorSubject<boolean>(navigator.onLine) private status$ = new BehaviorSubject<boolean>(navigator.onLine)
/* creates writableSignal */ /* creates writableSignal */
@ -32,6 +32,6 @@ export class InternetConnectionService{
/* returns OBSERVABLE */ /* returns OBSERVABLE */
get networkStatus$(){ get networkStatus$(){
return this.status$ return this.status$.asObservable()
} }
} }

Loading…
Cancel
Save