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
// foo_repository.cached.dart@overrideFuture<Foo> createFoo(Foo foo) async {
final result =awaitsuper.createFoo(foo);
_getFooCached["${foo.hashCode}"] = result;
return result;
}
Update:
// foo_repository.dartFuture<Foo> getFoo() async {
// ...
}
@EditCacheFuture<Foo> updateFoo(int a, String b) async {
await dataSource.update(a, b);
final foo =getFoo();
return foo.copyWith(a:a, b:b);
}
leading to
// foo_repository.cached.dart@overrideFuture<Foo> updateFoo(int a, String b) async {
final result =awaitsuper.updateFoo(a, b);
_getFooCached["${foo.hashCode}"] = result;
return result;
}
Alternatives Considered
No response
On which platorm do you expect this solution?
All
The text was updated successfully, but these errors were encountered:
Problem
When creating/updating data on a remote data source developers might want to update the local cache after that.
Desired Solution
In the most basic cases something like this could solve it.
Create:
leading to
Update:
leading to
Alternatives Considered
No response
On which platorm do you expect this solution?
All
The text was updated successfully, but these errors were encountered: