update method
Reads key, calls transform synchronously, writes its result (null removes), returns it.
Atomic with respect to every other update of key through this store, and, for IndexedDB,
through every store over the same database. transform must not await and treats a value it
cannot decode as absent. When transform throws, nothing is written and the error is rethrown.
Implementation
@override
Future<String?> update(
String key,
String? Function(String? current) transform,
) => _run(() async {
final String? current = await _read(key);
final String? next = transform(current);
if (next == null || next != current) {
await _write(key, next);
}
return next;
});