Module

TanStack.Query

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

#UseQuery Source

data UseQuery t0

#UseQueryArgs Source

type UseQueryArgs :: forall k. (Type -> k) -> Type -> Row ktype UseQueryArgs f output = (enabled :: f Boolean, queryFn :: f (Aff output), queryKey :: f QueryKey)

#useQueryImpl Source

useQueryImpl :: forall input output. EffectFn1 input { data :: output, error :: Error, fetchStatus :: String, isError :: Boolean, isPending :: Boolean }

#FetchStatus Source

#useQuery Source

useQuery :: forall opts opts_ @output. Flatten output output => Union opts opts_ (UseQueryArgs Id output) => Record opts -> Hook UseQuery { data :: RemoteData Error output, fetchStatus :: FetchStatus }

#UseMutation Source

data UseMutation t0

#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, onSettled :: f (Either Error output -> input -> ctx -> Aff Unit), onSuccess :: f (output -> input -> Effect Unit))

#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, onSettled :: Opt (EffectFn4 output (Nullable Error) input ctx (Promise Unit)), onSuccess :: Opt (EffectFn2 output input Unit) } (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)

#queryClientProviderImpl Source

#queryClientProvider Source

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

#QueryClient Source

#UseQueryClient Source

#invalidateQueries Source

#QueryKey Source

#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)

#getQueryData Source

#setQueryData Source