feat(mobile): lazy loading of assets (#2413)

This commit is contained in:
Fynn Petersen-Frey 2023-05-17 19:36:02 +02:00 committed by GitHub
parent 93863b0629
commit 0dde76bbbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 1494 additions and 2328 deletions

View file

@ -35,6 +35,10 @@ class Store {
return value;
}
/// Watches a specific key for changes
static Stream<T?> watch<T>(StoreKey<T> key) =>
_db.storeValues.watchObject(key.id).map((e) => e?._extract(key));
/// Returns the stored value for the given key (possibly null)
static T? tryGet<T>(StoreKey<T> key) => _cache[key.id];