RxJS Advanced
Architect, Compose, and Test
Agenda
Deep-dive into RxJS primitives
Comparison of different subject types
Observable as reactive primitive
The reactive context
Create custom RxJS operators
Angular RxJS best practices
Build reactive state management systems with RxJS
Memory efficiency and RxJS
The power of RxJS schedulers
Performance optimizations
Animations
Ergonomic background processes
A quick wrap-up on RxJS versions 7 & 8
(Performance) improvements
Fixes
Future changes
Custom Operators
Limitations of using pipe
Leveraging the observable lifecycle hooks
Write a custom higher-order operator
Testing
The clutter of asynchronous tests
Testing with async helpers
Marble testing
Higher order composition
Understand higher order observables
Learn combination & flattening operators
Use “All” operators like mergeAll
Understand the power of groupBy
Multicasting
Subjects rewound
The misuse of share operators
Understanding RxJS7 connectable observables
Description
Maintainable error handling and resilient data streams are a difficult but essential part of every vital application. The way we shape our state and the derived data streams is admittedly a matter of deep architecture knowledge, but also it involves dealing with the low-level problems of multicasting and shared state.
In this session, we will come to understand how to solve those problems from the inside out, create our own operators that are beyond using the pipe method, and implement our learnings in a reusable way.
As one of my favorite parts, we will reverse engineer Observables to have a clear picture of their lifecycle hooks and get a handle on how to leverage all of them in code.
To ensure we are safe from regressions, different testing approaches should be employed. Therefore, we will take a closer look at those and implement marble tests to cover teardown logic and avoid memory leaks over tests.
Takeaways
Understanding RxJS on an expert level
Effectively handling errors across RxJS applications
Creating reusable custom operators beyond using
pipe
Testing approaches protecting a code base against regressions
Marble testing with RxJS
Multicasting operators in RxJS7
Advanced error handling
Error-prone code encapsulation
A deep dive into Subjects
Multicasting with observables
Understand combination & flattening Operators
Stateful reactive programming