Skip to content

Commit

Permalink
Add missing exports
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Jul 16, 2024
1 parent c8713d6 commit 83eba3e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
10 changes: 5 additions & 5 deletions packages/svelte-query/src/QueryClientProvider.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts">
import { type Snippet, onDestroy, onMount } from 'svelte'
import { onDestroy, onMount } from 'svelte'
import { QueryClient } from '@tanstack/query-core'
import { setQueryClientContext } from './context'
import type { QueryClientProviderProps } from './types'
const { client = new QueryClient(), children }: QueryClientProviderProps =
$props()
const { client = new QueryClient(), children } = $props<{
client: QueryClient
children: Snippet
}>()
onMount(() => {
client.mount()
})
Expand Down
10 changes: 2 additions & 8 deletions packages/svelte-query/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/* istanbul ignore file */

import type { QueryClient } from '@tanstack/query-core'
import type { Snippet } from 'svelte'

// Re-export core
export * from '@tanstack/query-core'

Expand All @@ -11,6 +8,7 @@ export * from './types'
export * from './context'

export { createQuery } from './createQuery'
export type { QueriesResults, QueriesOptions } from './createQueries.svelte'
export type {
DefinedInitialDataOptions,
UndefinedInitialDataOptions,
Expand All @@ -20,15 +18,11 @@ export { createQueries } from './createQueries.svelte'
export { createInfiniteQuery } from './createInfiniteQuery'
export { infiniteQueryOptions } from './infiniteQueryOptions'
export { createMutation } from './createMutation.svelte'
export { useMutationState } from './useMutationState.svelte'
export { useQueryClient } from './useQueryClient'
export { useIsFetching } from './useIsFetching.svelte'
export { useIsMutating } from './useIsMutating.svelte'
export { useIsRestoring } from './useIsRestoring'
export { useHydrate } from './useHydrate'

export { default as HydrationBoundary } from './HydrationBoundary.svelte'
export { default as QueryClientProvider } from './QueryClientProvider.svelte'
export type QueryClientProviderProps = {
client: QueryClient
children?: Snippet
}
7 changes: 7 additions & 0 deletions packages/svelte-query/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Snippet } from 'svelte'
import type {
DefaultError,
DefinedQueryObserverResult,
Expand All @@ -6,6 +7,7 @@ import type {
MutateFunction,
MutationObserverOptions,
MutationObserverResult,
QueryClient,
QueryKey,
QueryObserverOptions,
QueryObserverResult,
Expand Down Expand Up @@ -136,3 +138,8 @@ export type CreateMutationResult<
> = CreateBaseMutationResult<TData, TError, TVariables, TContext>

type Override<A, B> = { [K in keyof A]: K extends keyof B ? B[K] : A[K] }

export type QueryClientProviderProps = {
client: QueryClient
children: Snippet
}

0 comments on commit 83eba3e

Please sign in to comment.