Thursday, January 23, 2020

.getValue and .next are really the stuff of BehaviorSubject not Observable in TypeScript

let foo = new BehaviorSubject<any>([
   { id: '1', name: 'Yin' },
   { id: '2', name: 'Yang' }
]);
let bar = foo.getValue();
console.log(bar);
foo.next(1);
let baz = foo.getValue();
console.log(baz);

No comments:

Post a Comment