StorageDecoder<V> typedef

StorageDecoder<V> = FutureOr<V> Function(dynamic storedValue)

Base interface for persistent storage decoding.

For example, if value is stored as json in the DB, then after retrieving data from the storage we need to convert it back. So we need decoder like that:

StorageDecoder<User> decoder = User.fromJson

Implementation

typedef StorageDecoder<V> = FutureOr<V> Function(dynamic storedValue);