StreamRepository<K, V>.remote constructor
StreamRepository<K, V>.remote ({
- required FetchData<
K, V> fetch, - CacheStorage<
K, V> ? storage, - Duration? cacheDuration,
- CacheDurationResolver<
K, V> ? cacheDurationResolver,
Creates repository with providing fetch
callback, typically used for REST API call.
Caches data in the passed CacheStorage. The default is MemoryCacheStorage.
Implementation
StreamRepository.remote({
required FetchData<K, V> fetch,
CacheStorage<K, V>? storage,
Duration? cacheDuration,
CacheDurationResolver<K, V>? cacheDurationResolver,
}) : this._(
fetch: fetch,
storage: storage ?? MemoryCacheStorage<K, V>(const Uuid().v4()),
cacheDuration: cacheDuration,
cacheDurationResolver: cacheDurationResolver,
);