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
Observable
and observer chains - Convert functions to
Observable
- Convert callbacks to
Observable
- Understand
subscribeOn
andobserveOn
- Understand
switchMap
- Test emitted values using
TestObserver
- Test work scheduling using
TestScheduler
- Use
compose
for operator sequences - Optimize your subscribers