fatih
02/05/2020, 9:43 AMFlow
on device rotation in Android if you are only using Flow
(without LiveData
)? I see that Dropbox Store library caches the latest and provides when it is requested again. https://github.com/dropbox/Store
The first time you call to suspend store.get(key), the response will be stored in an in-memory cache and in the persister, if provided. All subsequent calls to store.get(key) with the same Key will retrieve the cached version of the data, minimizing unnecessary data calls.
Since the Flow is cold it is going to be collected evertime.satyan
02/05/2020, 9:46 AMfatih
02/05/2020, 9:49 AMsatyan
02/05/2020, 9:50 AMfatih
02/05/2020, 9:53 AMsatyan
02/05/2020, 9:55 AMkevin.cianfarini
02/06/2020, 4:26 AMval statefulFlow = flow {
emit(savedState.get(...))
actualFlow.collect { emit(it) }
}
zak.taccardi
02/06/2020, 5:28 PMFlow<T>
should be backed by a ConflatedBroadcastChannel<T>
until StateFlow<T>
arrives in the next coroutines version. ConflatedBroadcastChannel<T>
behaves quite similarly to LiveData<T>
without the main thread limitation