load<T> method
Loads stored value from the store using its key. If value is missing in the store it returns null.
correlationId
(optional) transaction id to trace execution through call chain.key
a unique state key. Returns the state value ornull
if value wasn't found.
Implementation
@override
Future<T?> load<T>(String? correlationId, String key) async {
// Cleanup the stored states
_cleanup();
// Get entry from the store
var entry = _states.containsKey(key) ? _states[key] : null;
// Store has nothing
if (entry == null) {
return null;
}
return entry.getValue();
}