@dxos/react-ui
    Preparing search index...

    Variable useAsyncStateConst

    useAsyncState: <T>(
        cb: () => Promise<T | undefined>,
        deps?: any[],
    ) => [T | undefined, Dispatch<SetStateAction<T | undefined>>]

    NOTE: Use with care and when necessary to be able to cancel an async operation when unmounting.

    Type declaration

      • <T>(
            cb: () => Promise<T | undefined>,
            deps?: any[],
        ): [T | undefined, Dispatch<SetStateAction<T | undefined>>]
      • Type Parameters

        • T

        Parameters

        • cb: () => Promise<T | undefined>
        • Optionaldeps: any[]

        Returns [T | undefined, Dispatch<SetStateAction<T | undefined>>]