This is a collection of items, each specifying one general rule, to help you write RxJava code more effectively. It is modeled after two of my favorite technical books, Effective C++ and Effective Java. I appreciate not only the soundness of their contents, but the brevity of their writing style. I hope that Effective RxJava has the same value proposition.
For each rule I've attempted to provide relevant example code -- most of which is currently in production in the Khan Academy Android app.
- Use Retrolambda
- Emit immutable values
- Understand
Observableand observer chains - Convert functions to
Observable - Convert callbacks to
Observable - Understand
subscribeOnandobserveOn - Understand
switchMap - Test emitted values using
TestObserver - Test work scheduling using
TestScheduler - Use
composefor operator sequences - Optimize your subscribers