Module

TanStack.Query

Package
purescript-tanstack-query
Repository
rowtype-yoga/purescript-tanstack-query

#QueryKey Source

data QueryKey

QueryKey

#queryKey Source

queryKey :: forall a. WriteForeign a => a -> QueryKey

#startQueryKey Source

startQueryKey :: forall a b. WriteForeign a => WriteForeign b => a -> b -> QueryKey

#(!%) Source

Operator alias for TanStack.Query.startQueryKey (left-associative / precedence 4)

#appendQueryKey Source

appendQueryKey :: forall a. WriteForeign a => QueryKey -> a -> QueryKey

#(%) Source

Operator alias for TanStack.Query.appendQueryKey (left-associative / precedence 4)

#FetchStatus Source

data FetchStatus

FetchStatus / QueryStatus

Constructors

#QueryClient Source

data QueryClient

QueryClient

#newQueryClientWithConfigImpl Source

#QueryClientConfig Source

type QueryClientConfig :: Row Typetype QueryClientConfig = (defaultOptions :: { mutations :: { retry :: Opt Int, retryDelay :: Opt Int }, queries :: { gcTime :: Opt Int, refetchOnMount :: Opt Boolean, refetchOnReconnect :: Opt Boolean, refetchOnWindowFocus :: Opt Boolean, retry :: Opt Int, staleTime :: Opt Int } })

#newQueryClientWithConfig Source

newQueryClientWithConfig :: forall opts opts_. Union opts opts_ QueryClientConfig => Record opts -> Effect QueryClient

#UseQueryClient Source

#queryClientProviderImpl Source

#queryClientProvider Source

queryClientProvider :: { client :: QueryClient } -> (Array JSX) -> JSX

#invalidateQueries Source

invalidateQueries :: { queryKey :: QueryKey } -> QueryClient -> Effect Unit

QueryClient methods

#getQueryData Source

#setQueryData Source

#removeQueriesImpl Source

#removeQueries Source

removeQueries :: { queryKey :: QueryKey } -> QueryClient -> Effect Unit

#prefetchQueryImpl Source

prefetchQueryImpl :: forall a. EffectFn2 { queryFn :: Effect (Promise a), queryKey :: QueryKey } QueryClient (Promise Unit)

#prefetchQuery Source

prefetchQuery :: forall @output. Flatten output output => { queryFn :: Aff output, queryKey :: QueryKey } -> QueryClient -> Aff Unit

#fetchQueryImpl Source

fetchQueryImpl :: forall a. EffectFn2 { queryFn :: Effect (Promise a), queryKey :: QueryKey } QueryClient (Promise a)

#fetchQuery Source

fetchQuery :: forall @output. Flatten output output => { queryFn :: Aff output, queryKey :: QueryKey } -> QueryClient -> Aff output

#cancelQueriesImpl Source

#cancelQueries Source

cancelQueries :: { queryKey :: QueryKey } -> QueryClient -> Aff Unit

#resetQueriesImpl Source

#resetQueries Source

resetQueries :: { queryKey :: QueryKey } -> QueryClient -> Aff Unit

#refetchQueriesImpl Source

#refetchQueries Source

refetchQueries :: { queryKey :: QueryKey } -> QueryClient -> Aff Unit

#isFetchingImpl Source

#isFetching Source

isFetching :: { queryKey :: QueryKey } -> QueryClient -> Effect Int

#isMutatingImpl Source

#isMutating Source

isMutating :: { queryKey :: QueryKey } -> QueryClient -> Effect Int

#QueryState Source

type QueryState output = { data :: Nullable output, dataUpdatedAt :: Nullable Number, error :: Nullable Error, errorUpdatedAt :: Nullable Number, fetchStatus :: String, status :: String }

#getQueryStateImpl Source

#getQueryState Source

getQueryState :: forall output. QueryKey -> QueryClient -> Effect (Maybe (QueryState output))

#UseQuery Source

data UseQuery t0

useQuery

#UseQueryArgs Source

type UseQueryArgs :: forall k. (Type -> k) -> Type -> Row ktype UseQueryArgs f output = (enabled :: f Boolean, gcTime :: f Int, initialData :: f output, initialDataUpdatedAt :: f Number, networkMode :: f String, placeholderData :: f output, queryFn :: f (Aff output), queryKey :: f QueryKey, refetchInterval :: f Int, refetchOnMount :: f Boolean, refetchOnReconnect :: f Boolean, refetchOnWindowFocus :: f Boolean, retry :: f Int, retryDelay :: f Int, select :: f (output -> output), staleTime :: f Int, structuralSharing :: f Boolean)

#UseQueryImplResult Source

type UseQueryImplResult output = { data :: output, dataUpdatedAt :: Nullable Number, error :: Error, errorUpdatedAt :: Nullable Number, fetchStatus :: String, isError :: Boolean, isFetched :: Boolean, isPending :: Boolean, isPlaceholderData :: Boolean, isRefetchError :: Boolean, isRefetching :: Boolean, isStale :: Boolean, refetch :: Effect (Promise Unit), status :: String }

#useQueryImpl Source

useQueryImpl :: forall input output. EffectFn1 input (UseQueryImplResult output)

#UseQueryResult Source

type UseQueryResult output = { data :: RemoteData Error output, dataUpdatedAt :: Maybe Number, errorUpdatedAt :: Maybe Number, fetchStatus :: FetchStatus, isFetched :: Boolean, isPlaceholderData :: Boolean, isRefetchError :: Boolean, isRefetching :: Boolean, isStale :: Boolean, refetch :: Aff Unit, status :: QueryStatus }

#useQuery Source

useQuery :: forall opts opts_ @output. Flatten output output => Union opts opts_ (UseQueryArgs Id output) => Record opts -> Hook UseQuery (UseQueryResult output)

#UseMutation Source

data UseMutation t0

useMutation

#UseMutationArgs Source

type UseMutationArgs :: forall k. (Type -> k) -> Type -> Type -> Type -> Row ktype UseMutationArgs f input output ctx = (mutationFn :: f (input -> Aff output), mutationKey :: f String, onError :: f (Error -> input -> ctx -> Aff Unit), onMutate :: f (input -> Effect (Maybe ctx)), onSettled :: f (Either Error output -> input -> ctx -> Aff Unit), onSuccess :: f (output -> input -> Effect Unit), retry :: f Int, retryDelay :: f Int)

#UseMutationImplResult Source

type UseMutationImplResult input output = { data :: output, error :: Error, isError :: Boolean, isIdle :: Boolean, isPending :: Boolean, mutateAsync :: EffectFn1 input (Promise Unit), reset :: Effect Unit, submittedAt :: Nullable Instant, variables :: Nullable input }

#useMutationImpl Source

useMutationImpl :: forall input output ctx. EffectFn1 { mutationFn :: Opt (EffectFn1 input (Promise output)), mutationKey :: Opt String, onError :: Opt (EffectFn3 Error input ctx (Promise Unit)), onMutate :: Opt (EffectFn1 input (Nullable ctx)), onSettled :: Opt (EffectFn4 output (Nullable Error) input ctx (Promise Unit)), onSuccess :: Opt (EffectFn2 output input Unit), retry :: Opt Int, retryDelay :: Opt Int } (UseMutationImplResult input output)

#UseMutationResult Source

type UseMutationResult input output = { data :: RemoteData Error output, mutateAsync :: input -> Aff Unit, reset :: Effect Unit, submittedAt :: Maybe Instant, variables :: Maybe input }

#useMutation Source

useMutation :: forall opts opts_ input @output ctx. Flatten output output => Union opts opts_ (UseMutationArgs Id input output ctx) => Record opts -> Hook UseMutation (UseMutationResult input output)

#UseInfiniteQuery Source

data UseInfiniteQuery t0

useInfiniteQuery

#UseInfiniteQueryArgs Source

type UseInfiniteQueryArgs :: forall k. (Type -> k) -> Type -> Type -> Row ktype UseInfiniteQueryArgs f output pageParam = (enabled :: f Boolean, gcTime :: f Int, getNextPageParam :: f (output -> Array output -> pageParam), getPreviousPageParam :: f (output -> Array output -> pageParam), initialPageParam :: f pageParam, maxPages :: f Int, queryFn :: f ({ pageParam :: pageParam } -> Aff output), queryKey :: f QueryKey, refetchInterval :: f Int, refetchOnWindowFocus :: f Boolean, retry :: f Int, staleTime :: f Int)

#UseInfiniteQueryImplResult Source

type UseInfiniteQueryImplResult output pageParam = { data :: { pageParams :: Array pageParam, pages :: Array output }, error :: Error, fetchNextPage :: Effect (Promise Unit), fetchPreviousPage :: Effect (Promise Unit), fetchStatus :: String, hasNextPage :: Boolean, hasPreviousPage :: Boolean, isError :: Boolean, isFetchingNextPage :: Boolean, isFetchingPreviousPage :: Boolean, isPending :: Boolean, isRefetching :: Boolean, refetch :: Effect (Promise Unit) }

#useInfiniteQueryImpl Source

useInfiniteQueryImpl :: forall input output pageParam. EffectFn1 input (UseInfiniteQueryImplResult output pageParam)

#InfiniteData Source

type InfiniteData output pageParam = { pageParams :: Array pageParam, pages :: Array output }

#UseInfiniteQueryResult Source

type UseInfiniteQueryResult output pageParam = { data :: RemoteData Error (InfiniteData output pageParam), fetchNextPage :: Aff Unit, fetchPreviousPage :: Aff Unit, fetchStatus :: FetchStatus, hasNextPage :: Boolean, hasPreviousPage :: Boolean, isFetchingNextPage :: Boolean, isFetchingPreviousPage :: Boolean, isRefetching :: Boolean, refetch :: Aff Unit }

#useInfiniteQuery Source

useInfiniteQuery :: forall opts opts_ @output @pageParam. Flatten output output => Union opts opts_ (UseInfiniteQueryArgs Id output pageParam) => Record opts -> Hook UseInfiniteQuery (UseInfiniteQueryResult output pageParam)

#UseSuspenseQuery Source

data UseSuspenseQuery t0

useSuspenseQuery

#UseSuspenseQueryArgs Source

type UseSuspenseQueryArgs :: forall k. (Type -> k) -> Type -> Row ktype UseSuspenseQueryArgs f output = (gcTime :: f Int, initialData :: f output, initialDataUpdatedAt :: f Number, networkMode :: f String, queryFn :: f (Aff output), queryKey :: f QueryKey, refetchInterval :: f Int, refetchOnMount :: f Boolean, refetchOnReconnect :: f Boolean, refetchOnWindowFocus :: f Boolean, retry :: f Int, retryDelay :: f Int, select :: f (output -> output), staleTime :: f Int, structuralSharing :: f Boolean)

#UseSuspenseQueryResult Source

type UseSuspenseQueryResult output = { data :: output, dataUpdatedAt :: Maybe Number, fetchStatus :: FetchStatus, isRefetching :: Boolean, refetch :: Aff Unit, status :: QueryStatus }

#useSuspenseQueryImpl Source

useSuspenseQueryImpl :: forall input output. EffectFn1 input { data :: output, dataUpdatedAt :: Nullable Number, fetchStatus :: String, isRefetching :: Boolean, refetch :: Effect (Promise Unit), status :: String }

#useSuspenseQuery Source

useSuspenseQuery :: forall opts opts_ @output. Flatten output output => Union opts opts_ (UseSuspenseQueryArgs Id output) => Record opts -> Hook UseSuspenseQuery (UseSuspenseQueryResult output)

#UseSuspenseInfiniteQuery Source

data UseSuspenseInfiniteQuery t0

useSuspenseInfiniteQuery

#UseSuspenseInfiniteQueryArgs Source

type UseSuspenseInfiniteQueryArgs :: forall k. (Type -> k) -> Type -> Type -> Row ktype UseSuspenseInfiniteQueryArgs f output pageParam = (gcTime :: f Int, getNextPageParam :: f (output -> Array output -> pageParam), getPreviousPageParam :: f (output -> Array output -> pageParam), initialPageParam :: f pageParam, maxPages :: f Int, queryFn :: f ({ pageParam :: pageParam } -> Aff output), queryKey :: f QueryKey, refetchInterval :: f Int, retry :: f Int, staleTime :: f Int)

#UseSuspenseInfiniteQueryResult Source

type UseSuspenseInfiniteQueryResult output pageParam = { data :: InfiniteData output pageParam, fetchNextPage :: Aff Unit, fetchPreviousPage :: Aff Unit, fetchStatus :: FetchStatus, hasNextPage :: Boolean, hasPreviousPage :: Boolean, isFetchingNextPage :: Boolean, isFetchingPreviousPage :: Boolean, isRefetching :: Boolean, refetch :: Aff Unit }

#useSuspenseInfiniteQueryImpl Source

useSuspenseInfiniteQueryImpl :: forall input output pageParam. EffectFn1 input { data :: { pageParams :: Array pageParam, pages :: Array output }, fetchNextPage :: Effect (Promise Unit), fetchPreviousPage :: Effect (Promise Unit), fetchStatus :: String, hasNextPage :: Boolean, hasPreviousPage :: Boolean, isFetchingNextPage :: Boolean, isFetchingPreviousPage :: Boolean, isRefetching :: Boolean, refetch :: Effect (Promise Unit) }

#useSuspenseInfiniteQuery Source

useSuspenseInfiniteQuery :: forall opts opts_ @output @pageParam. Flatten output output => Union opts opts_ (UseSuspenseInfiniteQueryArgs Id output pageParam) => Record opts -> Hook UseSuspenseInfiniteQuery (UseSuspenseInfiniteQueryResult output pageParam)

#UseQueries Source

data UseQueries t0

useQueries

#UseQueryOptions Source

type UseQueryOptions output = { enabled :: Opt Boolean, gcTime :: Opt Int, queryFn :: Aff output, queryKey :: QueryKey, staleTime :: Opt Int }

#UseQueriesImplResult Source

type UseQueriesImplResult output = { data :: output, error :: Error, fetchStatus :: String, isError :: Boolean, isPending :: Boolean }

#useQueriesImpl Source

useQueriesImpl :: forall input output. EffectFn1 { queries :: input } (Array (UseQueriesImplResult output))

#useQueries Source

useQueries :: forall @output. Flatten output output => Array (UseQueryOptions output) -> Hook UseQueries (Array { data :: RemoteData Error output, fetchStatus :: FetchStatus })

#UseIsFetching Source

data UseIsFetching t0

useIsFetching

#useIsFetchingImpl Source

useIsFetchingImpl :: forall input. EffectFn1 input Int

#useIsFetching Source

useIsFetching :: forall opts opts_. Union opts opts_ (queryKey :: QueryKey) => Record opts -> Hook UseIsFetching Int

#UseIsMutating Source

data UseIsMutating t0

useIsMutating

#useIsMutatingImpl Source

useIsMutatingImpl :: forall input. EffectFn1 input Int

#useIsMutating Source

useIsMutating :: forall opts opts_. Union opts opts_ (mutationKey :: String) => Record opts -> Hook UseIsMutating Int

#UseMutationState Source

data UseMutationState t0

useMutationState

#MutationStateEntry Source

type MutationStateEntry = { data :: Nullable Foreign, error :: Nullable Error, status :: String, submittedAt :: Nullable Number, variables :: Nullable Foreign }

#useMutationStateImpl Source

#UseMutationStateFilters Source

type UseMutationStateFilters :: Row Typetype UseMutationStateFilters = (filters :: { mutationKey :: Opt String, status :: Opt String })

#useMutationState Source

#UseQueryErrorResetBoundary Source

data UseQueryErrorResetBoundary t0

QueryErrorResetBoundary

#useQueryErrorResetBoundaryImpl Source

#queryErrorResetBoundaryImpl Source

#queryErrorResetBoundary Source

queryErrorResetBoundary :: ({ reset :: Effect Unit } -> JSX) -> JSX

#DehydratedState Source

data DehydratedState

HydrationBoundary

#hydrationBoundaryImpl Source

#hydrationBoundary Source

#skipTokenImpl Source

skipTokenImpl :: forall a. a

Utilities

#skipToken Source

skipToken :: forall output. Aff output