4 ms·
Hey, here is a talk I gave about rewriting Rx with async iterators (a complex example is shown) - https://docs.google.com/presentation/d/1nAi7fTa2K9XUIDSG7Bg1XZ
by inglor 10y ago
Hey, here is a talk I gave about rewriting Rx with async iterators (a complex example is shown) - https://docs.google.com/presentation/d/1nAi7fTa2K9XUIDSG7Bg1XZw7tr0RgGpurqjVq2iDebs/edit?usp=sharing https://docs.google.com/presentation/d/1nAi7fTa2K9XUIDSG7Bg1...
- johnsonjo 10y agoThis is really neat. I liked how you showed it could all be done in one for loop. It really does make it seem much simpler than RxJS or the example you gave with the async generator utility functions. At the same time I do love reusable utility functions, but they have more mental overhead because of their abstract nature.
- Matthias247 10y agoNice presentation. I have used Rx in some previous projects, however for new things I now also prefer pull-style APIs with possible async/await like you have shown. From my point of view they are easier to comprehend (more normal syntax instead of magic operators), easier testable (less callbacks in tests) and allow a better ingeration overall (e.g. you can move ownership of the object which is iterated upon between components without doing things like complete/unsubscribe and caring about whether it's a hot observable and unsubscription might loose events). One remark about your slides: Your implementation of "throttle" might not be what one would expect from a debounce/throttle function, as it will never emit the last value if this is filtered (shortly occurs after a previous one). In most applications the last value of an eventstream is important, as it represents the most recent / final state. E.g. for the example which makes HTTP queries out of form data you would never make a query for the final text content if the last keystroke happenend in the debounce period for the previous one.