RxJS send passed to new subscribers with ReplaySubject

node v14.18.3
version: 1.0.0
endpointsharetweet
const rxjs = require('rxjs'); const { ReplaySubject } = rxjs const subject = new ReplaySubject(2); // buffer 3 values for new subscribers subject.subscribe({ next: (v) => console.log(`observerA: ${v}`) }); subject.next(1); subject.next(2); subject.next(3); subject.subscribe({ next: (v) => console.log(`observerB: ${v}`) }); subject.next(4); subject.next(5);
Loading…

no comments

    sign in to comment