Code:
const cold = new Observable((observer: Observer<any>) => {
observer.next(Math.random());
});
const hot = cold.pipe(share());
hot.subscribe(a => console.log('a: ' + a));
hot.subscribe(b => console.log('b: ' + b));
}
Expected result - a and b has the same value:
// a: 0.17919353301075858
// b: 0.17919353301075858
Actual result - only get value of a in the browser console:
// a: 0.07958207844185083
Any idea?