Home > @plasmicapp/query > useMutablePlasmicQueryData

useMutablePlasmicQueryData() function

Fetches data asynchronously using SWR Hook (https://swr.vercel.app/)

Signature:

export declare function useMutablePlasmicQueryData<T, E>(key: Key, fetcher: Fetcher<T>, options?: SWRConfiguration<T, E>): SWRResponse<T, E> & {
    isLoading?: boolean;
    isLagging?: boolean;
};

Parameters

Parameter Type Description
key Key a unique key for this data fetch; if data already exists under this key, that data is returned immediately.
fetcher Fetcher<T> an async function that resolves to the fetched data.
options SWRConfiguration<T, E> (Optional) (optional) an object of options for this hook (https://swr.vercel.app/docs/options).

Returns:

SWRResponse<T, E> & { isLoading?: boolean; isLagging?: boolean; }

an object with either a "data" key with the fetched data if the fetch was successful, or an "error" key with the thrown Error if the fetch failed.