Function withLoadingState

  • Adds a loading state which is initially false. Once the callback is invoked, it is set to true. After the callback resolves or rejects, it is set to false again.

    Returns

    callback with a loading state

    See

    CallbackWithState

    Type Parameters

    • A extends any[]

    • R

    Parameters

    • callback: ((...args: A) => Promise<R>)

      callback function

        • (...args: A): Promise<R>
        • Parameters

          • Rest ...args: A

          Returns Promise<R>

    Returns CallbackWithState<((...args: A) => Promise<R>), {
        loading: boolean;
    }>

Generated using TypeDoc