RequestResult
a shared result type that encapsulates errors instead of throwing them, allows you to optionally specify the ErrorType
type RequestResult<T, ErrorType extends Error = AuthError> = {
data: T;
error: null;
} | {data: null;
};a shared result type that encapsulates errors instead of throwing them, allows you to optionally specify the ErrorType