Function useQueryV

  • Hook that provides a reactive way to fetch data asynchronously and update the synchronous state of the application.

    Parameters

    • selector: string

      The selector for the synchronous state object to update.

    • asyncFn: (() => Promise<unknown>)

      The asynchronous function to call and get data.

        • (): Promise<unknown>
        • Returns Promise<unknown>

    • config: {
          cacheData?: boolean;
          updateAsyncV?: { deleteExistingData?: boolean | undefined; };
          useAsyncV?: { initialState?: { loading?: boolean | undefined; data?: null | undefined; error?: boolean | undefined; } | undefined; };
      } = useQueryVDefaultConfig

      The configuration object for the hook. Optional. useQueryVDefaultConfig

      • Optional cacheData?: boolean
      • Optional updateAsyncV?: { deleteExistingData?: boolean | undefined; }
      • Optional useAsyncV?: { initialState?: { loading?: boolean | undefined; data?: null | undefined; error?: boolean | undefined; } | undefined; }

    Returns {
        data: null;
        error: boolean;
        loading: boolean;
    } & object

Generated using TypeDoc