get<T, Y> method

Future<T> get<T, Y>(
  1. SessionKey sessionKey, [
  2. T converter(
    1. Y
    )?
])

get an object T from sessionKey position

a factory function converter can be provided to convert from stored type Y to desired return type T

Implementation

Future<T> get<T, Y>(SessionKey sessionKey, [T Function(Y)? converter]) async {
  if (converter == null) return _get<T>(sessionKey.key);
  return converter(await _get<Y>(sessionKey.key));
}