12 Matching Annotations
  1. Apr 2021
  2. Dec 2020
    1. const store = observable({ players: [ "Player 1", "Player 2", ], // ... }) reaction(() => JSON.stringify(store), json => { localStorage.setItem('store',json); }, { delay: 500, }); let json = localStorage.getItem('store'); if(json) { Object.assign(store, JSON.parse(json)); }
  3. Oct 2020
    1. this.txtQueryChanged .debounceTime(1000) // wait 1 sec after the last event before emitting last event .distinctUntilChanged() // only emit if value is different from previous value .subscribe(model => { this.txtQuery = model;
    1. With Angular 2 we can debounce using RxJS operator debounceTime() on a form control's valueChanges observable:

      What's the React/Svelte equiv. pattern for this?

    1. Indeed, this simple contract is very close to that of an ob­serv­able, such as those provided by Rxjs. set is basically equiv­a­lent to next in the ob­serv­able world.
    2. I would prefer the BehaviorSubject , which allows us to kick off with an initial value.
  4. Sep 2020
    1. For interoperability with RxJS Observables, the .subscribe method is also allowed to return an object with an .unsubscribe method, rather than return the unsubscription function directly.
  5. Sep 2019
  6. Jan 2014