feat: add todo cache repository and precise invalidation
This commit is contained in:
+1
-8
@@ -1,19 +1,12 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'hybrid_cache_store.dart';
|
||||
|
||||
class CacheInvalidator {
|
||||
final HybridCacheStore? _store;
|
||||
final Set<String> _invalidated = <String>{};
|
||||
|
||||
CacheInvalidator({HybridCacheStore? store}) : _store = store;
|
||||
CacheInvalidator({HybridCacheStore? store});
|
||||
|
||||
void invalidate(String key) {
|
||||
_invalidated.add(key);
|
||||
final removeFuture = _store?.remove(key);
|
||||
if (removeFuture != null) {
|
||||
unawaited(removeFuture);
|
||||
}
|
||||
}
|
||||
|
||||
void invalidateCalendarDay(DateTime date) {
|
||||
|
||||
Reference in New Issue
Block a user