I have a need to set the value of my BehaviorSubject without triggering a next call to any subscriptions.
I tried doing this:
this.mySubject = new BehaviorSubject(newVal);
but that removes all of the subscriptions as well.
this.mySubject.value = newVal;
doesn't work because .value
is readonly.
Is there any way to accomplish this?
Edit: for those asking why I need to do this...
This is an Ionic 4 app, so there is the root list page that calls 2 other child pages (a detail view and an edit page). The first naviagtion into the view page needs the model that was selected. The list page sets the initial value of this model into the BehaviorSubject, then navigates into the view page. However, the setting of this initial value triggers the refresh of the list, which I don't want to do. I just want to init the value, then listen in case the edit page changes it and THEN refresh my list.