Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

RxJS pass current value with BehaviourSubject

node v14.19.2
version: 1.0.0
endpointsharetweet
const rxjs = require('rxjs'); const { BehaviorSubject } = rxjs const subject = new BehaviorSubject(0); // 0 is the initial value subject.subscribe({ next: (v) => console.log(`observerA: ${v}`) }); subject.next(1); subject.next(2); subject.subscribe({ next: (v) => console.log(`observerB: ${v}`) }); subject.next(3);
Loading…

no comments

    sign in to comment