Created
January 13, 2021 23:17
-
-
Save Zeko369/a0bd1acbb6feeeee512294f9ab6d44e7 to your computer and use it in GitHub Desktop.
Blitz useQuery without suspnse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FirstParam, PromiseType, QueryFn, useQuery as useBaseQuery } from "blitz" | |
import { QueryConfig } from "react-query" | |
export const useQuery = <T extends QueryFn, TResult = PromiseType<ReturnType<T>>>( | |
queryFn: T, | |
params: FirstParam<T>, | |
options?: QueryConfig<TResult, unknown> | undefined | |
) => { | |
return useBaseQuery(queryFn, params, { suspense: false, ...options }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment