How do I retrieve the current value of the observable generated by readValue()
below without subscribing to it?
var subject = new BehaviorSubject<Object>({});
observe(): Observable<Object> {
return subject.pipe(map(mappingfunction));
}
Do I need to create another BehaviourSubject as shown here?
var other_subject = new BehaviorSubject<Object>();
observer().subscribe(other_subject);
var value = other_subject.currentValue();
In theory, it should be possible to access the currentValue directly since it will always be available due to the original behavioursubject passing the last result through the pipe. However, unless complicating factors are introduced, like bouncing, I don't foresee any issues.