-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Description
Describe the bug
When subscribe to shared observable multiple times internal connection to the source observable gets broken. It stops emit values on subscribe.
Expected behavior
Expected output:
first: 7.5.1
second: 7.5.1
Actual output
first: 7.5.1
Reproduction code
import { BehaviorSubject, merge, of, Subject } from 'rxjs';
import {
shareReplay,
take,
takeUntil,
materialize,
filter,
} from 'rxjs/operators';
const shared$ = new BehaviorSubject('7.5.1').pipe(
shareReplay({ refCount: true, bufferSize: 1 })
);
const isCompleted$ = shared$.pipe(
materialize(),
filter((n) => n.kind === 'C'),
take(1)
);
const work = new Subject().pipe(takeUntil(isCompleted$));
merge(work, shared$)
.pipe(take(1))
.subscribe((value) => console.log('first: ', value));
shared$.subscribe((value) => console.log('second:', value));
Reproduction URL
Version
7.5.1
Environment
No response
Additional context
No response
jkossis, TheWrightDev and vixncu
Metadata
Metadata
Assignees
Labels
No labels