GenericRepository
The default Repository: reads/writes a LocalDataSource and falls through to the network per CachePolicy, always writing through to local storage on a successful network load. Mirrors SwiftyNetwork's GenericRepository.
Concurrent loads for the same CacheKey are coalesced: a burst of callers that all miss the cache triggers a single network request whose result they all await — the same single-flight pattern the network layer uses for token refresh.
Parameters
coroutine scope hosting the coalesced loads. Pass your own to tie loads to a lifecycle you control; when omitted, an internal SupervisorJob on Dispatchers.Default is created and close cancels it. close never cancels a scope you supplied.
Prefer the reified GenericRepository(networkDataSource, localDataSource) factory below, which captures responseType for you.
Constructors
Functions
Observes the entity like stream, also emitting null when its local value is removed.