data class LocalCacheState<CACHE : Any>
Local response (response 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 response at any given time.
This class is used in companion with LocalRepository and LocalCacheStateBehaviorSubject to maintain the state of cacheData to deliver to someone observing.
object Testing
Used for testing purposes to create instances of LocalCacheState. |
val cacheData: CACHE? |
|
val isEmpty: Boolean |
|
val requirements: GetCacheRequirements? |
fun deliverState(listener: LocalCacheStateListener<CACHE>): Unit
This is usually used in the UI of an app to display cache to a user. |