handle<T> method
dynamic
handle<T>({})
Implementation
handle<T>({
required Future<T> Function() fetch,
required Function(T t) onValue,
Function(Object error)? onError,
}) async {
try {
onValue(await fetch());
} catch (error) {
onResponseError(error);
onError?.call(error);
}
}