You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The iOS version of Teller has recently been updated with a new API for parsing the state of DataState.
Here it is:
repository
.observe().observeOn(ConcurrentDispatchQueueScheduler(qos:.background)).subscribeOn(MainScheduler.instance).subscribe(onNext:{(dataState:DataState<[Repo]>)in
switch dataState.state(){case.noCache(let fetching,let errorDuringFetch):
// Repos have never been fetched before for the GitHub user.
break
case.cache(let cache,let lastFetched,let firstCache,let fetching,let successfulFetch,let errorDuringFetch):
// Repos have been fetched before for the GitHub user.
// If `cache` is nil, the cache is empty.
break
}
switch dataState.fetchingState(){case.fetching(let fetching,let noCache,let errorDuringFetch,let successfulFetch):
// A new cache could be fetching, just completed fetching, or is not fetching at all.
break
}})
This is pretty similar to Android's version of Teller with a couple differences:
case cache() has different parameters in it for better understanding the state of the cache.
A new, separate, fetchingState(). This is something I have been wanting to have added to the library has I build more apps with Teller. I find myself handling the fetching state of the data in this fashion where it's a separate function from cache() and noCache().
The text was updated successfully, but these errors were encountered:
The iOS version of Teller has recently been updated with a new API for parsing the state of
DataState
.Here it is:
This is pretty similar to Android's version of Teller with a couple differences:
case cache()
has different parameters in it for better understanding the state of the cache.fetchingState()
. This is something I have been wanting to have added to the library has I build more apps with Teller. I find myself handling the fetching state of the data in this fashion where it's a separate function fromcache()
andnoCache()
.The text was updated successfully, but these errors were encountered: