Issue with RxJs BehaviorSubject's subscriber not being notified of value change

前端 未结 2 585
误落风尘
误落风尘 2020-12-19 13:20

I am trying to use a RxJS BehaviorSubject that contains a boolean representing whether or not a user is connected/logged in the application.

<
2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-19 13:48

    I usually provide SessionService at bootstrap (and not with providers: []) to make sure you share one global SessionService instance throughout the entire app.

    bootstrap(AppComponent,
                [SessionService]);
    

提交回复
热议问题