Skip to content

Latest commit

 

History

History
25 lines (20 loc) · 513 Bytes

react.asyncresult.md

File metadata and controls

25 lines (20 loc) · 513 Bytes

Home > @cerbos/react > AsyncResult

AsyncResult type

The result of calling an async method on a client.

Signature:

export type AsyncResult<T> = {
    isLoading: true;
    data: undefined;
    error: undefined;
} | {
    isLoading: false;
    data: T;
    error: undefined;
} | {
    isLoading: false;
    data: undefined;
    error: Error;
};