Open ischeinkman opened 8 years ago
Benefits (cont): -Allows for the combination of multiple info streams into one -Allows for building a sequence of events for downloading, storing, and displaying information without having to wait at each section
We now have an rxjava branch. Will discuss more with contributors.
Right now our interactions with the database, Internet, etc are done by synchronous methods of a "handler" class returning some InfoWrapper[] executed in seperate AsyncTask threads. I propose instead of having a handler InfoWrapper[] getWrappersFromSource() method that is then executed from an async task, the handler has an Observable getWrappersFromSource() method and the UI activity/fragment/view then subscribes to the observable using RxJava.
Benefits: Allows partial loading Easier error handling Easier UI testability Don't have to worry about AsyncTasks
Drawbacks: Reactive programming has a learning curve. Even I took a while to understand it. Introduces a new dependency to the API