What would be a good pattern to make repositories, which usually just fetch data from retrofit APIs, fully reactive (i.e. offer long term subscriptions, not
Single
)?
Maybe maintain
BehaviorSubject
with the API results from the last fetch, but when / how do I fetch?
z
Zach Klippenstein (he/him) [MOD]
03/27/2020, 4:36 PM
This isn’t specifically an Rx solution, it uses coroutines’ Flow, but you can easily adapt those to Rx streams: https://github.com/dropbox/Store