@tanstack/solid-query 4.29.22 → 4.29.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/QueryClientProvider.d.ts.map +1 -1
- package/build/lib/QueryClientProvider.esm.js.map +1 -1
- package/build/lib/QueryClientProvider.js.map +1 -1
- package/build/lib/QueryClientProvider.mjs.map +1 -1
- package/build/lib/__tests__/utils.d.ts +1 -1
- package/build/lib/__tests__/utils.d.ts.map +1 -1
- package/build/lib/createBaseQuery.d.ts.map +1 -1
- package/build/lib/createBaseQuery.esm.js +2 -1
- package/build/lib/createBaseQuery.esm.js.map +1 -1
- package/build/lib/createBaseQuery.js +2 -1
- package/build/lib/createBaseQuery.js.map +1 -1
- package/build/lib/createBaseQuery.mjs +2 -1
- package/build/lib/createBaseQuery.mjs.map +1 -1
- package/build/lib/createInfiniteQuery.d.ts +1 -1
- package/build/lib/createInfiniteQuery.d.ts.map +1 -1
- package/build/lib/createInfiniteQuery.esm.js +1 -1
- package/build/lib/createInfiniteQuery.esm.js.map +1 -1
- package/build/lib/createInfiniteQuery.js +1 -1
- package/build/lib/createInfiniteQuery.js.map +1 -1
- package/build/lib/createInfiniteQuery.mjs +1 -1
- package/build/lib/createInfiniteQuery.mjs.map +1 -1
- package/build/lib/createMutation.d.ts +1 -1
- package/build/lib/createMutation.d.ts.map +1 -1
- package/build/lib/createMutation.esm.js +1 -1
- package/build/lib/createMutation.esm.js.map +1 -1
- package/build/lib/createMutation.js +1 -1
- package/build/lib/createMutation.js.map +1 -1
- package/build/lib/createMutation.mjs +1 -1
- package/build/lib/createMutation.mjs.map +1 -1
- package/build/lib/createQueries.d.ts +1 -1
- package/build/lib/createQueries.d.ts.map +1 -1
- package/build/lib/createQueries.esm.js +1 -3
- package/build/lib/createQueries.esm.js.map +1 -1
- package/build/lib/createQueries.js +1 -3
- package/build/lib/createQueries.js.map +1 -1
- package/build/lib/createQueries.mjs +1 -3
- package/build/lib/createQueries.mjs.map +1 -1
- package/build/lib/createQuery.d.ts +1 -1
- package/build/lib/createQuery.d.ts.map +1 -1
- package/build/lib/createQuery.esm.js +0 -5
- package/build/lib/createQuery.esm.js.map +1 -1
- package/build/lib/createQuery.js +0 -5
- package/build/lib/createQuery.js.map +1 -1
- package/build/lib/createQuery.mjs +0 -5
- package/build/lib/createQuery.mjs.map +1 -1
- package/build/lib/types.d.ts +1 -1
- package/build/lib/types.d.ts.map +1 -1
- package/build/lib/useIsFetching.d.ts +1 -1
- package/build/lib/useIsFetching.d.ts.map +1 -1
- package/build/lib/useIsFetching.esm.js +1 -1
- package/build/lib/useIsFetching.esm.js.map +1 -1
- package/build/lib/useIsFetching.js +1 -1
- package/build/lib/useIsFetching.js.map +1 -1
- package/build/lib/useIsFetching.mjs +1 -1
- package/build/lib/useIsFetching.mjs.map +1 -1
- package/build/lib/useIsMutating.d.ts +1 -1
- package/build/lib/useIsMutating.d.ts.map +1 -1
- package/build/lib/useIsMutating.esm.js +1 -1
- package/build/lib/useIsMutating.esm.js.map +1 -1
- package/build/lib/useIsMutating.js +1 -1
- package/build/lib/useIsMutating.js.map +1 -1
- package/build/lib/useIsMutating.mjs +1 -1
- package/build/lib/useIsMutating.mjs.map +1 -1
- package/build/lib/utils.d.ts +1 -1
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.esm.js.map +1 -1
- package/build/lib/utils.js.map +1 -1
- package/build/lib/utils.mjs.map +1 -1
- package/build/solid/QueryClientProvider.jsx +1 -1
- package/build/solid/__tests__/QueryClientProvider.test.jsx +2 -2
- package/build/solid/__tests__/createInfiniteQuery.test.jsx +2 -2
- package/build/solid/__tests__/createMutation.test.jsx +2 -2
- package/build/solid/__tests__/createQueries.test.jsx +2 -2
- package/build/solid/__tests__/createQuery.test.jsx +2 -2
- package/build/solid/__tests__/suspense.test.jsx +2 -2
- package/build/solid/__tests__/transition.test.jsx +2 -2
- package/build/solid/__tests__/useIsFetching.test.jsx +2 -2
- package/build/solid/__tests__/useIsMutating.test.jsx +3 -3
- package/build/solid/__tests__/utils.jsx +1 -1
- package/build/solid/createBaseQuery.js +2 -2
- package/build/solid/createInfiniteQuery.js +1 -1
- package/build/solid/createMutation.js +3 -3
- package/build/solid/createQueries.js +1 -1
- package/build/solid/useIsFetching.js +1 -1
- package/build/solid/useIsMutating.js +1 -1
- package/build/umd/index.development.js +7 -11
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -2
- package/src/QueryClientProvider.tsx +5 -5
- package/src/__tests__/QueryClientProvider.test.tsx +3 -3
- package/src/__tests__/createInfiniteQuery.test.tsx +6 -7
- package/src/__tests__/createMutation.test.tsx +4 -4
- package/src/__tests__/createQueries.test.tsx +13 -13
- package/src/__tests__/createQuery.test.tsx +11 -11
- package/src/__tests__/suspense.test.tsx +6 -6
- package/src/__tests__/transition.test.tsx +2 -2
- package/src/__tests__/useIsFetching.test.tsx +4 -4
- package/src/__tests__/useIsMutating.test.tsx +9 -9
- package/src/__tests__/utils.tsx +2 -2
- package/src/createBaseQuery.ts +7 -7
- package/src/createInfiniteQuery.ts +9 -9
- package/src/createMutation.ts +5 -5
- package/src/createQueries.ts +3 -3
- package/src/createQuery.ts +5 -5
- package/src/types.ts +7 -7
- package/src/useIsFetching.ts +4 -4
- package/src/useIsMutating.ts +3 -3
- package/src/utils.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query",
|
|
3
|
-
"version": "4.29.
|
|
3
|
+
"version": "4.29.25",
|
|
4
4
|
"description": "Primitives for managing, caching and syncing asynchronous and remote data in Solid",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"solid-jest": "^0.2.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@tanstack/query-core": "4.29.
|
|
39
|
+
"@tanstack/query-core": "4.29.25"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"solid-js": "^1.5.7"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { QueryClient } from '@tanstack/query-core'
|
|
2
|
-
import type { Context, JSX } from 'solid-js'
|
|
3
1
|
import {
|
|
4
2
|
createContext,
|
|
5
|
-
useContext,
|
|
6
|
-
onMount,
|
|
7
|
-
onCleanup,
|
|
8
3
|
mergeProps,
|
|
4
|
+
onCleanup,
|
|
5
|
+
onMount,
|
|
6
|
+
useContext,
|
|
9
7
|
} from 'solid-js'
|
|
8
|
+
import type { QueryClient } from '@tanstack/query-core'
|
|
9
|
+
import type { Context, JSX } from 'solid-js'
|
|
10
10
|
import type { ContextOptions } from './types'
|
|
11
11
|
|
|
12
12
|
declare global {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { render, screen, waitFor } from 'solid-testing-library'
|
|
2
|
-
import { queryKey } from './utils'
|
|
3
2
|
|
|
4
3
|
import { QueryCache, QueryClient } from '@tanstack/query-core'
|
|
5
|
-
import type { Context } from 'solid-js'
|
|
6
4
|
import { createContext, useContext } from 'solid-js'
|
|
7
5
|
import { renderToString } from 'solid-js/web'
|
|
8
|
-
import {
|
|
6
|
+
import { QueryClientProvider, createQuery, useQueryClient } from '..'
|
|
7
|
+
import { queryKey } from './utils'
|
|
9
8
|
import { createQueryClient, sleep } from './utils'
|
|
9
|
+
import type { Context } from 'solid-js'
|
|
10
10
|
|
|
11
11
|
describe('QueryClientProvider', () => {
|
|
12
12
|
it('sets a specific cache for all queries to use', async () => {
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
|
|
2
2
|
|
|
3
|
-
import { createQueryClient, sleep } from './utils'
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
|
-
createEffect,
|
|
7
|
-
createRenderEffect,
|
|
8
|
-
createSignal,
|
|
9
4
|
For,
|
|
10
5
|
Index,
|
|
11
6
|
Match,
|
|
12
7
|
Switch,
|
|
8
|
+
createEffect,
|
|
9
|
+
createRenderEffect,
|
|
10
|
+
createSignal,
|
|
13
11
|
} from 'solid-js'
|
|
12
|
+
import { QueryCache, QueryClientProvider, createInfiniteQuery } from '..'
|
|
13
|
+
import { createQueryClient, sleep } from './utils'
|
|
14
|
+
import { Blink, queryKey, setActTimeout } from './utils'
|
|
14
15
|
import type {
|
|
15
16
|
CreateInfiniteQueryResult,
|
|
16
17
|
InfiniteData,
|
|
17
18
|
QueryFunctionContext,
|
|
18
19
|
} from '..'
|
|
19
|
-
import { createInfiniteQuery, QueryCache, QueryClientProvider } from '..'
|
|
20
|
-
import { Blink, queryKey, setActTimeout } from './utils'
|
|
21
20
|
|
|
22
21
|
interface Result {
|
|
23
22
|
items: number[]
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import '@testing-library/jest-dom'
|
|
2
2
|
import {
|
|
3
|
+
ErrorBoundary,
|
|
3
4
|
createContext,
|
|
4
5
|
createEffect,
|
|
5
6
|
createRenderEffect,
|
|
6
7
|
createSignal,
|
|
7
|
-
ErrorBoundary,
|
|
8
8
|
} from 'solid-js'
|
|
9
9
|
import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
|
|
10
|
-
import type { QueryClient } from '..'
|
|
11
10
|
import {
|
|
12
|
-
createMutation,
|
|
13
11
|
MutationCache,
|
|
14
12
|
QueryCache,
|
|
15
13
|
QueryClientProvider,
|
|
14
|
+
createMutation,
|
|
16
15
|
} from '..'
|
|
17
|
-
import type { CreateMutationResult } from '../types'
|
|
18
16
|
import {
|
|
19
17
|
createQueryClient,
|
|
20
18
|
mockNavigatorOnLine,
|
|
@@ -22,6 +20,8 @@ import {
|
|
|
22
20
|
setActTimeout,
|
|
23
21
|
sleep,
|
|
24
22
|
} from './utils'
|
|
23
|
+
import type { QueryClient } from '..'
|
|
24
|
+
import type { CreateMutationResult } from '../types'
|
|
25
25
|
|
|
26
26
|
describe('useMutation', () => {
|
|
27
27
|
const queryCache = new QueryCache()
|
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
|
|
2
2
|
|
|
3
|
-
import * as QueriesObserverModule from '../../../query-core/src/queriesObserver'
|
|
4
|
-
|
|
5
|
-
import type { QueryFunctionContext } from '@tanstack/query-core'
|
|
6
3
|
import {
|
|
4
|
+
ErrorBoundary,
|
|
7
5
|
createContext,
|
|
8
6
|
createMemo,
|
|
9
7
|
createRenderEffect,
|
|
10
8
|
createSignal,
|
|
11
|
-
ErrorBoundary,
|
|
12
9
|
} from 'solid-js'
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
CreateQueryResult,
|
|
16
|
-
QueryClient,
|
|
17
|
-
QueryFunction,
|
|
18
|
-
QueryObserverResult,
|
|
19
|
-
SolidQueryKey,
|
|
20
|
-
} from '..'
|
|
10
|
+
import * as QueriesObserverModule from '../../../query-core/src/queriesObserver'
|
|
11
|
+
|
|
21
12
|
import {
|
|
22
|
-
createQueries,
|
|
23
13
|
QueriesObserver,
|
|
24
14
|
QueryCache,
|
|
25
15
|
QueryClientProvider,
|
|
16
|
+
createQueries,
|
|
26
17
|
} from '..'
|
|
27
18
|
import {
|
|
28
19
|
createQueryClient,
|
|
@@ -31,6 +22,15 @@ import {
|
|
|
31
22
|
queryKey,
|
|
32
23
|
sleep,
|
|
33
24
|
} from './utils'
|
|
25
|
+
import type { QueryFunctionContext } from '@tanstack/query-core'
|
|
26
|
+
import type {
|
|
27
|
+
CreateQueryOptions,
|
|
28
|
+
CreateQueryResult,
|
|
29
|
+
QueryClient,
|
|
30
|
+
QueryFunction,
|
|
31
|
+
QueryObserverResult,
|
|
32
|
+
SolidQueryKey,
|
|
33
|
+
} from '..'
|
|
34
34
|
|
|
35
35
|
describe('useQueries', () => {
|
|
36
36
|
const queryCache = new QueryCache()
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
import '@testing-library/jest-dom'
|
|
2
|
-
import type { JSX } from 'solid-js'
|
|
3
2
|
import {
|
|
3
|
+
ErrorBoundary,
|
|
4
|
+
Match,
|
|
5
|
+
Switch,
|
|
4
6
|
createEffect,
|
|
5
7
|
createMemo,
|
|
6
8
|
createRenderEffect,
|
|
7
9
|
createSignal,
|
|
8
|
-
ErrorBoundary,
|
|
9
|
-
Match,
|
|
10
10
|
on,
|
|
11
|
-
Switch,
|
|
12
11
|
} from 'solid-js'
|
|
13
12
|
import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
|
|
14
|
-
import
|
|
15
|
-
CreateQueryOptions,
|
|
16
|
-
CreateQueryResult,
|
|
17
|
-
DefinedCreateQueryResult,
|
|
18
|
-
QueryFunction,
|
|
19
|
-
} from '..'
|
|
20
|
-
import { createQuery, QueryCache, QueryClientProvider } from '..'
|
|
13
|
+
import { QueryCache, QueryClientProvider, createQuery } from '..'
|
|
21
14
|
import {
|
|
22
15
|
Blink,
|
|
23
16
|
createQueryClient,
|
|
@@ -29,6 +22,13 @@ import {
|
|
|
29
22
|
setActTimeout,
|
|
30
23
|
sleep,
|
|
31
24
|
} from './utils'
|
|
25
|
+
import type {
|
|
26
|
+
CreateQueryOptions,
|
|
27
|
+
CreateQueryResult,
|
|
28
|
+
DefinedCreateQueryResult,
|
|
29
|
+
QueryFunction,
|
|
30
|
+
} from '..'
|
|
31
|
+
import type { JSX } from 'solid-js'
|
|
32
32
|
|
|
33
33
|
describe('createQuery', () => {
|
|
34
34
|
const queryCache = new QueryCache()
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
-
createRenderEffect,
|
|
5
|
-
createSignal,
|
|
6
4
|
ErrorBoundary,
|
|
7
|
-
on,
|
|
8
5
|
Show,
|
|
9
6
|
Suspense,
|
|
7
|
+
createRenderEffect,
|
|
8
|
+
createSignal,
|
|
9
|
+
on,
|
|
10
10
|
} from 'solid-js'
|
|
11
|
-
import type { CreateInfiniteQueryResult, CreateQueryResult } from '..'
|
|
12
11
|
import {
|
|
13
|
-
createInfiniteQuery,
|
|
14
|
-
createQuery,
|
|
15
12
|
QueryCache,
|
|
16
13
|
QueryClientProvider,
|
|
14
|
+
createInfiniteQuery,
|
|
15
|
+
createQuery,
|
|
17
16
|
} from '..'
|
|
18
17
|
import { createQueryClient, queryKey, sleep } from './utils'
|
|
18
|
+
import type { CreateInfiniteQueryResult, CreateQueryResult } from '..'
|
|
19
19
|
|
|
20
20
|
describe("useQuery's in Suspense mode", () => {
|
|
21
21
|
const queryCache = new QueryCache()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Show, Suspense, createSignal, startTransition } from 'solid-js'
|
|
4
|
+
import { QueryCache, QueryClientProvider, createQuery } from '..'
|
|
5
5
|
import { createQueryClient, queryKey, sleep } from './utils'
|
|
6
6
|
|
|
7
7
|
describe("useQuery's in Suspense mode with transitions", () => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { fireEvent, render, screen, waitFor } from 'solid-testing-library'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
ErrorBoundary,
|
|
5
|
+
Show,
|
|
4
6
|
createContext,
|
|
5
7
|
createEffect,
|
|
6
8
|
createRenderEffect,
|
|
7
9
|
createSignal,
|
|
8
|
-
ErrorBoundary,
|
|
9
|
-
Show,
|
|
10
10
|
} from 'solid-js'
|
|
11
|
-
import
|
|
12
|
-
import { createQuery, QueryCache, QueryClientProvider, useIsFetching } from '..'
|
|
11
|
+
import { QueryCache, QueryClientProvider, createQuery, useIsFetching } from '..'
|
|
13
12
|
import { createQueryClient, queryKey, setActTimeout, sleep } from './utils'
|
|
13
|
+
import type { QueryClient } from '..'
|
|
14
14
|
|
|
15
15
|
describe('useIsFetching', () => {
|
|
16
16
|
// See https://github.com/tannerlinsley/react-query/issues/105
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { fireEvent, screen, waitFor } from 'solid-testing-library'
|
|
2
|
-
import {
|
|
3
|
-
createMutation,
|
|
4
|
-
QueryClient,
|
|
5
|
-
QueryClientProvider,
|
|
6
|
-
useIsMutating,
|
|
7
|
-
} from '..'
|
|
8
|
-
import { createQueryClient, sleep } from './utils'
|
|
9
2
|
|
|
10
3
|
import {
|
|
4
|
+
ErrorBoundary,
|
|
5
|
+
Show,
|
|
11
6
|
createContext,
|
|
12
7
|
createEffect,
|
|
13
8
|
createRenderEffect,
|
|
14
9
|
createSignal,
|
|
15
|
-
ErrorBoundary,
|
|
16
|
-
Show,
|
|
17
10
|
} from 'solid-js'
|
|
18
11
|
import { render } from 'solid-testing-library'
|
|
12
|
+
import {
|
|
13
|
+
QueryClient,
|
|
14
|
+
QueryClientProvider,
|
|
15
|
+
createMutation,
|
|
16
|
+
useIsMutating,
|
|
17
|
+
} from '..'
|
|
19
18
|
import * as MutationCacheModule from '../../../query-core/src/mutationCache'
|
|
19
|
+
import { createQueryClient, sleep } from './utils'
|
|
20
20
|
import { setActTimeout } from './utils'
|
|
21
21
|
|
|
22
22
|
describe('useIsMutating', () => {
|
package/src/__tests__/utils.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { QueryClientConfig } from '@tanstack/query-core'
|
|
2
1
|
import { QueryClient } from '@tanstack/query-core'
|
|
2
|
+
import { Show, createEffect, createSignal, onCleanup } from 'solid-js'
|
|
3
|
+
import type { QueryClientConfig } from '@tanstack/query-core'
|
|
3
4
|
import type { ParentProps } from 'solid-js'
|
|
4
|
-
import { createEffect, createSignal, onCleanup, Show } from 'solid-js'
|
|
5
5
|
|
|
6
6
|
let queryKeyCount = 0
|
|
7
7
|
export function queryKey(): () => Array<string> {
|
package/src/createBaseQuery.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { QueryObserver } from '@tanstack/query-core'
|
|
2
|
-
import type { QueryKey, QueryObserverResult } from '@tanstack/query-core'
|
|
3
|
-
import type { CreateBaseQueryOptions } from './types'
|
|
4
|
-
import { useQueryClient } from './QueryClientProvider'
|
|
5
1
|
import {
|
|
6
|
-
|
|
7
|
-
onCleanup,
|
|
2
|
+
batch,
|
|
8
3
|
createComputed,
|
|
9
4
|
createResource,
|
|
10
5
|
on,
|
|
11
|
-
|
|
6
|
+
onCleanup,
|
|
7
|
+
onMount,
|
|
12
8
|
} from 'solid-js'
|
|
13
9
|
import { createStore, unwrap } from 'solid-js/store'
|
|
10
|
+
import { useQueryClient } from './QueryClientProvider'
|
|
14
11
|
import { shouldThrowError } from './utils'
|
|
12
|
+
import type { QueryObserver } from '@tanstack/query-core'
|
|
13
|
+
import type { QueryKey, QueryObserverResult } from '@tanstack/query-core'
|
|
14
|
+
import type { CreateBaseQueryOptions } from './types'
|
|
15
15
|
|
|
16
16
|
// Base Query Function that is used to create the query.
|
|
17
17
|
export function createBaseQuery<
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
QueryObserver,
|
|
3
|
-
QueryFunction,
|
|
4
|
-
QueryOptions,
|
|
5
|
-
} from '@tanstack/query-core'
|
|
6
1
|
import { InfiniteQueryObserver } from '@tanstack/query-core'
|
|
2
|
+
import { createComputed } from 'solid-js'
|
|
3
|
+
import { createStore } from 'solid-js/store'
|
|
4
|
+
import { createBaseQuery } from './createBaseQuery'
|
|
5
|
+
import { parseQueryArgs } from './utils'
|
|
7
6
|
import type {
|
|
8
7
|
CreateInfiniteQueryOptions,
|
|
9
8
|
CreateInfiniteQueryResult,
|
|
10
9
|
SolidQueryKey,
|
|
11
10
|
} from './types'
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
import type {
|
|
12
|
+
QueryFunction,
|
|
13
|
+
QueryObserver,
|
|
14
|
+
QueryOptions,
|
|
15
|
+
} from '@tanstack/query-core'
|
|
16
16
|
|
|
17
17
|
export function createInfiniteQuery<
|
|
18
18
|
TQueryFnData = unknown,
|
package/src/createMutation.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { MutationObserver, parseMutationArgs } from '@tanstack/query-core'
|
|
2
|
+
import { createComputed, on, onCleanup } from 'solid-js'
|
|
3
|
+
import { createStore } from 'solid-js/store'
|
|
3
4
|
import { useQueryClient } from './QueryClientProvider'
|
|
5
|
+
import { shouldThrowError } from './utils'
|
|
4
6
|
import type {
|
|
5
7
|
CreateMutateFunction,
|
|
6
8
|
CreateMutationOptions,
|
|
7
9
|
CreateMutationResult,
|
|
8
10
|
} from './types'
|
|
9
|
-
import {
|
|
10
|
-
import { createStore } from 'solid-js/store'
|
|
11
|
-
import { shouldThrowError } from './utils'
|
|
11
|
+
import type { MutationFunction, MutationKey } from '@tanstack/query-core'
|
|
12
12
|
|
|
13
13
|
// HOOK
|
|
14
14
|
export function createMutation<
|
package/src/createQueries.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createComputed, onCleanup, onMount } from 'solid-js'
|
|
2
|
-
import type { QueryFunction } from '@tanstack/query-core'
|
|
3
2
|
import { QueriesObserver } from '@tanstack/query-core'
|
|
3
|
+
import { createStore, unwrap } from 'solid-js/store'
|
|
4
4
|
import { useQueryClient } from './QueryClientProvider'
|
|
5
|
+
import { scheduleMicrotask } from './utils'
|
|
5
6
|
import type {
|
|
6
7
|
CreateQueryOptions,
|
|
7
8
|
CreateQueryResult,
|
|
8
9
|
SolidQueryKey,
|
|
9
10
|
} from './types'
|
|
10
|
-
import {
|
|
11
|
-
import { scheduleMicrotask } from './utils'
|
|
11
|
+
import type { QueryFunction } from '@tanstack/query-core'
|
|
12
12
|
|
|
13
13
|
// This defines the `UseQueryOptions` that are accepted in `QueriesOptions` & `GetOptions`.
|
|
14
14
|
// - `context` is omitted as it is passed as a root-level option to `useQueries` instead.
|
package/src/createQuery.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { QueryFunction, QueryOptions } from '@tanstack/query-core'
|
|
2
1
|
import { QueryObserver } from '@tanstack/query-core'
|
|
2
|
+
import { createComputed } from 'solid-js'
|
|
3
|
+
import { createStore } from 'solid-js/store'
|
|
4
|
+
import { parseQueryArgs } from './utils'
|
|
5
|
+
import { createBaseQuery } from './createBaseQuery'
|
|
3
6
|
import type {
|
|
4
7
|
CreateQueryOptions,
|
|
5
8
|
CreateQueryResult,
|
|
6
9
|
DefinedCreateQueryResult,
|
|
7
10
|
SolidQueryKey,
|
|
8
11
|
} from './types'
|
|
9
|
-
import {
|
|
10
|
-
import { createStore } from 'solid-js/store'
|
|
11
|
-
import { parseQueryArgs } from './utils'
|
|
12
|
-
import { createBaseQuery } from './createBaseQuery'
|
|
12
|
+
import type { QueryFunction, QueryOptions } from '@tanstack/query-core'
|
|
13
13
|
|
|
14
14
|
// There are several ways to create a query.
|
|
15
15
|
// 1. createQuery(options: CreateQueryOptions)
|
package/src/types.ts
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
import type { Context } from 'solid-js'
|
|
4
4
|
import type {
|
|
5
|
-
QueryClient,
|
|
6
|
-
QueryKey,
|
|
7
|
-
QueryObserverOptions,
|
|
8
|
-
QueryObserverResult,
|
|
9
|
-
MutateFunction,
|
|
10
|
-
MutationObserverOptions,
|
|
11
|
-
MutationObserverResult,
|
|
12
5
|
DefinedQueryObserverResult,
|
|
13
6
|
InfiniteQueryObserverOptions,
|
|
14
7
|
InfiniteQueryObserverResult,
|
|
8
|
+
MutateFunction,
|
|
9
|
+
MutationObserverOptions,
|
|
10
|
+
MutationObserverResult,
|
|
11
|
+
QueryClient,
|
|
15
12
|
QueryFilters,
|
|
13
|
+
QueryKey,
|
|
14
|
+
QueryObserverOptions,
|
|
15
|
+
QueryObserverResult,
|
|
16
16
|
QueryOptions,
|
|
17
17
|
} from '@tanstack/query-core'
|
|
18
18
|
|
package/src/useIsFetching.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { createComputed, createMemo, createSignal, onCleanup } from 'solid-js'
|
|
2
|
+
import { useQueryClient } from './QueryClientProvider'
|
|
3
|
+
import { parseFilterArgs } from './utils'
|
|
1
4
|
import type { QueryFilters } from '@tanstack/query-core'
|
|
2
5
|
|
|
3
|
-
import type { ContextOptions,
|
|
4
|
-
import { useQueryClient } from './QueryClientProvider'
|
|
6
|
+
import type { ContextOptions, SolidQueryFilters, SolidQueryKey } from './types'
|
|
5
7
|
import type { Accessor } from 'solid-js'
|
|
6
|
-
import { createSignal, onCleanup, createComputed, createMemo } from 'solid-js'
|
|
7
|
-
import { parseFilterArgs } from './utils'
|
|
8
8
|
|
|
9
9
|
interface Options extends ContextOptions {}
|
|
10
10
|
|
package/src/useIsMutating.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { MutationKey, MutationFilters } from '@tanstack/query-core'
|
|
2
1
|
import { parseMutationFilterArgs } from '@tanstack/query-core'
|
|
3
|
-
import
|
|
2
|
+
import { createSignal, onCleanup } from 'solid-js'
|
|
4
3
|
import { useQueryClient } from './QueryClientProvider'
|
|
4
|
+
import type { MutationFilters, MutationKey } from '@tanstack/query-core'
|
|
5
|
+
import type { ContextOptions } from './types'
|
|
5
6
|
import type { Accessor } from 'solid-js'
|
|
6
|
-
import { createSignal, onCleanup } from 'solid-js'
|
|
7
7
|
|
|
8
8
|
interface Options extends ContextOptions {}
|
|
9
9
|
|