Upgrade to Pro — share decks privately, control downloads, hide ads and more …

redux-observable-preso.pdf

 redux-observable-preso.pdf

My talk about RxJS and redux-observable on 21st Aug 2018 at NAB.

mattyao1984

August 21, 2018
Tweet

More Decks by mattyao1984

Other Decks in Technology

Transcript

  1. CHANGES IN RXJS6 catch() => catchError() do() => tap() finally()

    => finalize() switch() => switchAll() Operators are renamed And so does some observable-creation methods throw() => throwError() fromPromise() => from()
  2. HOW WE NORMALLY DO IT? Redux-thunk - It is a

    function - It can accept no arguments - It returns another function
  3. PAIN POINTS OF REDUX • Complex user interactions (keyboard, mouse,

    touchpad) • Http requests chain • Timer / Intervals / Transitions • WebSockets • Web Workers • Cancellation of requests • Repeat / Retry requests Async / Side effects functions Callback Hell
  4. WHAT’S AN EPIC? A function that takes a stream of

    all actions dispatched and returns a stream of new actions to dispatch. “Actions in, actions out”
  5. WHAT’S AN EPIC? • It is a factory and only

    gets called once • It is established along with the application and dispatch the action immediately and automatically
  6. LET’S RECAP… • Make it easier to compose and control

    complex async tasks, over any amount of time • Can work with existed Redux structure but adding a little bit cream on top • Can use all redux and RxJS tooling