CHAN.RUN

ensure

AsyncResult

Result of tryAsync — error type narrows when wrapping a declared function.

AsyncResult<T, E>

type AsyncResult<T, E> = 
  | {
  data: T;
  ok: true;
}
  | {
  error: E;
  ok: false;
};

Defined in: src/types.ts

Result of tryAsync — error type narrows when wrapping a declared function.

Type Parameters

Type ParameterDefault type
T-
Eunknown