Dominic Elm & Kwinten Pisman - RxJS Recipes - Uphill Conf 2019

Sdílet
Vložit
  • čas přidán 11. 05. 2019
  • RxJS is one of my personal favorite technologies. But, the problem with RxJS is the very high learning curve. In this talk, we will take a look at some patterns that can be applied to Angular applications and some more advanced recipes that you should be able to use in your own projects!
    RxJS is a great tool to develop frontend applications. But, as everyone knows, the learning curve to get started with RxJS is very steep. Lots of people struggle with writing proper reactive code and are mixing this with imperative code. From my personal experience, mixing these two paradigms can be the source of a great deal of bugs.
    In this talk, I want to focus on patterns and recipes with RxJS. During trainings and code reviews, I’ve noticed that most people are starting to get the basics but are struggling to apply more advanced patterns into their code. This is the problem I want to address.
    For some time now, I’ve been documenting patterns that I’ve applied frequently. Some of the challenges that can be addressed by these patterns are:
    restarting some piece of work
    periodically triggering work
    conditionally executing work
    These patterns can help a lot but are not sufficient. The second part of my talk, I want to focus on helping people reason about the code they need to write. To do that, I want to show them a ‘divide-and-conquer’ way of thinking.
    First of all, we try to find the source streams. These are streams that can influence the view or trigger backend calls, for example page changes, typing in an input field, dragging, … Secondly, we try to identify the output streams. These are the streams that are feeding the view. Once we have these, we can try and find the intermediate streams. These are the ones we need to go from the source streams to the output streams. During this step, the patterns we’ve seen can be applied. We can for example have a certain stream that needs to be restarted when a certain action is triggered.
    By identifying some common patterns and showing how to split what we need to do in smaller pieces, I hope to teach the participants how to write better RxJS code!
  • Věda a technologie

Komentáře • 2