value method
Retrieves the value at key
or null
if there is no data.
Implementation
@override
Future<Map<String, dynamic>?> value(String key) {
return _mutex.protectRead(() async {
final inMemoryValue = _memory[key];
if (inMemoryValue != null) {
return Map<String, dynamic>.of(inMemoryValue);
}
final localStorageValue = await _level2.value(key);
if (localStorageValue != null) {
_memory[key] = localStorageValue;
return Map<String, dynamic>.of(localStorageValue);
}
return null;
});
}