levibostian / Teller-iOS

iOS library that manages your app's cached data with ease.
MIT License
13 stars 0 forks source link

Assert that a cache exists #82

Closed levibostian closed 4 years ago

levibostian commented 4 years ago

While developing an iOS app today, I encountered a use case: I have an app that uses Firebase remote config. Some apps cannot function without a set of data that is fetched from a remote server. Some apps simply cannot function without any cache. Once it has a cache, it works. But it needs some sort of cache or it will not work.

Proposal: Add to Repository something like this...

func assertCacheExists() throws -> Single<RefreshResult> 

This function behaves just like refresh() does, except that it only runs refresh if no cache exists at all. Else, it will not call the refresh.