Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

From zero to hero with the reactive extensions for JavaScript

29 views

Published on

From zero to hero with the reactive extensions for JavaScript presentation at the DevDays Vilnius 2019

Published in: Technology
  • Be the first to comment

  • Be the first to like this

From zero to hero with the reactive extensions for JavaScript

  1. 1. From zero to hero with the Reactive Extensions forJavaScript Maurice de Beijer @mauricedb
  2. 2. Who am I?  Maurice de Beijer  The Problem Solver  MicrosoftAzure MVP  Freelance developer/instructor  Twitter: @mauricedb and @React_Tutorial  Web: http://www.TheProblemSolver.nl  E-mail: maurice.de.beijer@gmail.com 2
  3. 3. Topics  What is RxJS?  Why use it?  How to create observables.  Using operators with observables.
  4. 4. Observer pattern
  5. 5. Iterator pattern
  6. 6. Why?  Reactive programming.  Programming with asynchronous data streams.  Most actions are not standalone occurrences.  Example: A mouse click triggers an Ajax request which triggers a UI update.  RxJS composes these streams in a functional style.
  7. 7. Filtering data
  8. 8. With array functions
  9. 9. With RxJS
  10. 10. Fetching data
  11. 11. With promises
  12. 12. With RxJS
  13. 13. Timer based
  14. 14. With imperative code
  15. 15. With RxJS
  16. 16. Observables
  17. 17. The RxJS Observable  An Observable is the object that emits a stream of event.  The observer is the code that subscribes to the event stream.
  18. 18. A simple clock
  19. 19. Unsubscribing
  20. 20. Creating observables
  21. 21. Operators
  22. 22. RxJS operators  Operators are used to operate on the event stream between the source and the subscriber.  There are many operators for all sorts of purposes:  Transforming  Filtering  Combining  Error handling  Aggregate  …
  23. 23. RxMarbles Interactive diagrams of RxObservables
  24. 24. Events
  25. 25. Ajax
  26. 26. Retry failed requests
  27. 27. Retry with backing off
  28. 28. Combining streams  Streams can be combined in may ways:  Switching  Combine  Merging  Zip  …
  29. 29. Merge Example
  30. 30. Paint example
  31. 31. Conclusion  Reactive programming is very powerful.  Compose multiple asynchronous data streams.  Transform streams using operators as needed.  Retry failures.  Cancel subscriptions as needed.
  32. 32. Thank you Maurice de Beijer - @mauricedb

×