data class OnlineDataState<CACHE : Any>
Holds the current state of data that is obtained via a network call. This data structure is meant to be passed out of Teller and to the application using Teller so it can parse it and display the data representation in the app. The online data state is not manipulated here. It is only stored. Data in apps are in 1 of 3 different types of state:
val cacheData: CACHE? |
|
val errorDuringFetch: Throwable? |
|
val errorDuringFirstFetch: Throwable? |
|
val fetchingForFirstTime: Boolean |
|
val isFetchingFreshData: Boolean |
|
val justCompletedSuccessfulFirstFetch: Boolean |
|
val justCompletedSuccessfullyFetchingFreshData: Boolean |
|
val lastTimeFetched: Date? |
|
val noCacheExists: Boolean |
|
val requirements: GetDataRequirements? |
fun deliverAllStates(listener: OnlineDataStateListener<CACHE>): Unit
Receive the full status of the data. |
|
fun deliverCacheState(listener: OnlineDataStateCacheListener<CACHE>): Unit
This is usually used in the UI of an app to display the cached data to a user. |
|
fun deliverFetchingFreshCacheState(listener: OnlineDataStateFetchingListener): Unit
This is usually used in the UI of an app to display the status of loading the data type for the first time to a user. |
|
fun deliverNoCacheState(listener: OnlineDataStateNoCacheStateListener): Unit
This is usually used in the UI of an app to display that the cached data on the device is empty to a user. |
|
fun equals(other: Any?): Boolean |
|
fun hashCode(): Int |
|
fun toString(): String |