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

Rx.js Workshop Intro

Rx.js Workshop Intro

Nikita Galkin

March 03, 2018
Tweet

More Decks by Nikita Galkin

Other Decks in Programming

Transcript

  1. RxJS workshop for JS developers March 3, 2018

  2. Верю, что: ▰ Любая проблема должна решаться на нужно уровне

    ▰ Сложности не в технологиях, сложности в людях ▰ Проблемы надо обсуждать, идеи – продавать, а решения – демонстрировать 2 Никита Галкин
  3. 1. Understand RxJS concept 2. Create observables 3. Filter Events

    Based on a Predicate with RxJS filter 4. Inspect the Behavior of Operators with RxJS do 5. Filter Events with RxJS Operators take, first, and skip 6. Control the Output of Values with RxJS Operator with LatestFrom 7. Drop and Delay Observable Emissions with RxJS debounce Программа 3
  4. 8. Handle Errors with RxJS catch 9. Resubscribe to an

    Observable on Error with RxJS retry 10. Repeat the Execution of an Observable with RxJS repeat 11. Hot observables 12. Connectable observables 13. More operators and conclusion Программа 4
  5. Understand RxJS concept or let’s talk about FRP

  6. Programming paradigms 6 Pascal, C Java, C++ Haskell, Lisp Prolog

  7. Imperative vs Declarative 7 Telling the computer how to do

    something, and as a result what you want to happen will happen. Imperative programming Telling the computer what you would like to happen, and let the computer figure out how to do it. Declarative programming 5
  8. Imperative vs Declarative 8 Imperative programming Declarative programming

  9. Advantages of Declarative Programming 9 • Minimizes mutability • Reduces

    state side-effects • More understandable code • More scalable
  10. Functional programming 10 Functional programming is a programming paradigm that

    treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data
  11. Functional programming 11 const numbers = [1, 2, 3, 4,

    5, 6] const doubled = numbers.map(x => x*x) const sum = doubled.reduce((a,b) => a +b))
  12. FRP 12 Functional reactive programming (FRP) is a programming paradigm

    for reactive programming using the building blocks of functional programming
  13. FP VS FRP 13 FP ▰ Style SYNCHRONOUS ▰ Single

    – Function ▰ Multiple – Enumerable FRP ▰ Style ASYNCHRONOUS ▰ Single – Promise ▰ Multiple – Observable
  14. Streams 14 ▰ Value ▰ Array ▰ Promise ▰ Events

    ▻ DOM ▻ SSE ▻ WS
  15. • Documentations ◦ http://reactivex.io/rxjs/ ◦ https://www.learnrxjs.io • Demos ◦ http://reactive.how

    ◦ http://rxmarbles.com ◦ https://rxviz.com • Other ◦ https://github.com/ichpuchtli/awesome-rxjs Links 15
  16. 16 Let’s coding with Rx.js! Твиттер: @galk_in Слайды: speakerdeck.com/galkin Сайт:

    galk.in