How do I use the multicast()
operator with the new recommended approach in RxJS 5.5 of using pipe()
instead of chaining operators? I get a TypeScript error when I try to use connect()
like I did before:
const even$ = new Subject();
const connectedSub = interval(500)
.pipe(
filter(count => count % 2 === 0),
take(5),
multicast(even$)
)
.connect();
even$.subscribe(value => console.log(value));
This code works but yields a TypeScript error that reports that Property 'connect' does not exist on type 'Observable<{}>'.
Am I using connectable observables the way that I should be in RxJS 5.5+?