Type alias RequestResult<T, ErrorType>

RequestResult<T, ErrorType>: {
    data: T;
    error: null;
} | {
    data: null;
    error: Error extends AuthError ? AuthError : ErrorType;
}

a shared result type that encapsulates errors instead of throwing them, allows you to optionally specify the ErrorType

Type Parameters

Generated using TypeDoc