data class LocalDataState<CACHE : Any>
Local data (data obtained from the user or device, no network fetch call) in apps are in 1 of 2 different types of state:
This class takes in a type of cacheData to keep state on via generic CACHE and it maintains the state of that cacheData. It gives you a snapshot of the state of your local data at any given time.
This class is used in companion with LocalRepository and LocalDataStateCompoundBehaviorSubject to maintain the state of cacheData to deliver to someone observing.
val cacheData: CACHE? |
|
val isEmpty: Boolean |
fun deliverState(listener: LocalDataStateListener<CACHE>): Unit
This is usually used in the UI of an app to display cacheData to a user. |