Type alias OperationResult

OperationResult: {
    error: AuthError | undefined;
    operation: AuthOperationName | null;
    pending: boolean;
    state: OperationState;
    success: boolean;
}

Represents the state and result of a call to a hook operation. This is designed to allow the user to update their UI accordingly without needing to store separate React state to keep track of pending/error states etc.

Type declaration

  • error: AuthError | undefined

    The error returned from the operation, if any. This will only be populated if state === OperationState.Error, and will be cleared each time the operation is called.

  • operation: AuthOperationName | null

    The string name of the current operation running.

  • pending: boolean

    Convenience accessors, so users can write e.g. loginResult.pending instead of loginResult.state === OperationState.Pending

  • state: OperationState

    The current state of the operation.

  • success: boolean

Generated using TypeDoc