@ainias42/tanstack-ids 0.0.4 → 0.0.6
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/dist/QueryContext/QueriesContextProvider.js +2 -2
- package/dist/QueryContext/QueriesContextProvider.js.map +1 -1
- package/dist/QueryContext/SubQueriesContext.js +3 -3
- package/dist/QueryContext/SubQueriesContext.js.map +1 -1
- package/dist/QueryContext/useGenerateQueriesContextId.js +1 -1
- package/dist/QueryContext/useGenerateQueriesContextId.js.map +1 -1
- package/dist/QueryContext/useQueriesError.js +2 -2
- package/dist/QueryContext/useQueriesError.js.map +1 -1
- package/dist/QueryContext/useQueriesIsFetching.js +2 -2
- package/dist/QueryContext/useQueriesIsFetching.js.map +1 -1
- package/dist/QueryContext/useQueriesReload.js +2 -2
- package/dist/QueryContext/useQueriesReload.js.map +1 -1
- package/dist/QueryContext/useQuerySubscribeToReload.js +2 -2
- package/dist/QueryContext/useQuerySubscribeToReload.js.map +1 -1
- package/dist/QueryContext/useScopedQueriesIsFetching.js +2 -2
- package/dist/QueryContext/useScopedQueriesIsFetching.js.map +1 -1
- package/dist/generateIdsQuery.d.ts +7 -7
- package/dist/generateNestedIdQuery.d.ts +12 -12
- package/dist/hooks/useIndexedData.d.ts +1 -1
- package/dist/noop.js +1 -0
- package/dist/noop.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +37 -38
- package/src/QueryContext/QueriesContextProvider.tsx +2 -2
- package/src/QueryContext/SubQueriesContext.tsx +3 -3
- package/src/QueryContext/useGenerateQueriesContextId.ts +1 -1
- package/src/QueryContext/useQueriesError.ts +2 -2
- package/src/QueryContext/useQueriesIsFetching.ts +2 -2
- package/src/QueryContext/useQueriesReload.ts +2 -2
- package/src/QueryContext/useQuerySubscribeToReload.ts +2 -2
- package/src/QueryContext/useScopedQueriesIsFetching.ts +2 -2
- package/src/generateIdsQuery.ts +5 -5
- package/src/generateNestedIdQuery.ts +3 -3
- package/src/generateQuery.ts +2 -2
- package/src/noop.ts +1 -0
- package/stylelint.config.mjs +4 -0
- package/tsconfig.json +8 -24
package/package.json
CHANGED
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
}
|
|
2
|
+
"name": "@ainias42/tanstack-ids",
|
|
3
|
+
"version": "0.0.6",
|
|
4
|
+
"description": "",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "ctix build && tsc && tsc-alias",
|
|
14
|
+
"lint:noCache": "eslint \"src/{**/*,*}.{js,jsx,tsx,ts}\" --max-warnings 0",
|
|
15
|
+
"lint": "npm run lint:noCache -- --cache",
|
|
16
|
+
"lint:fix": "npm run lint -- --fix",
|
|
17
|
+
"typecheck": "tsc --noEmit",
|
|
18
|
+
"prettier": "npm run prettier:list -- --write",
|
|
19
|
+
"prettier:list": "prettier --list-different \"src/**/*.{ts,tsx,js,jsx,json}\"",
|
|
20
|
+
"stylelint": "stylelint --allow-empty-input \"src/**/*.{css,scss}\"",
|
|
21
|
+
"stylelint:fix": "npm run stylelint -- --fix"
|
|
22
|
+
},
|
|
23
|
+
"type": "module",
|
|
24
|
+
"author": "",
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "gitea@git.silas.link:Ainias/libraries.git"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@ainias42/react-bootstrap-mobile": "*",
|
|
31
|
+
"@ainias42/config": "*",
|
|
32
|
+
"@ainias42/js-helper": ">=0.8.19",
|
|
33
|
+
"@tanstack/react-query": "^5.85.5",
|
|
34
|
+
"@yornaath/batshit": "^0.10.1",
|
|
35
|
+
"react-query-kit": "^3.3.2",
|
|
36
|
+
"zustand": "^5.0.8"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {}
|
|
40
39
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { QueriesContext } from '
|
|
2
|
-
import { useGenerateQueriesContextId } from '
|
|
1
|
+
import { QueriesContext } from './QueriesContext';
|
|
2
|
+
import { useGenerateQueriesContextId } from './useGenerateQueriesContextId';
|
|
3
3
|
import { withMemo } from '@ainias42/react-bootstrap-mobile';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import type { ReactNode } from 'react';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { QueriesContext } from '
|
|
1
|
+
import { QueriesContext } from './QueriesContext';
|
|
2
2
|
import { useClientLayoutEffect, withMemo } from '@ainias42/react-bootstrap-mobile';
|
|
3
|
-
import { useGenerateQueriesContextId } from '
|
|
4
|
-
import { useQueriesStore } from '
|
|
3
|
+
import { useGenerateQueriesContextId } from './useGenerateQueriesContextId';
|
|
4
|
+
import { useQueriesStore } from './useQueriesStore';
|
|
5
5
|
import React, { type ReactNode, useContext } from 'react';
|
|
6
6
|
|
|
7
7
|
export type SubQueriesContextProps = { children: ReactNode; subContextId?: number };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import { useQueriesStore } from '
|
|
2
|
+
import { useQueriesStore } from './useQueriesStore';
|
|
3
3
|
|
|
4
4
|
export function useGenerateQueriesContextId() {
|
|
5
5
|
const generateId = useQueriesStore((s) => s.generateContextId);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QueriesContext } from '
|
|
1
|
+
import { QueriesContext } from './QueriesContext';
|
|
2
2
|
import { useContext } from 'react';
|
|
3
|
-
import { useQueriesStore } from '
|
|
3
|
+
import { useQueriesStore } from './useQueriesStore';
|
|
4
4
|
|
|
5
5
|
export function useQueriesError(contextId?: number) {
|
|
6
6
|
const context = useContext(QueriesContext);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QueriesContext } from '
|
|
1
|
+
import { QueriesContext } from './QueriesContext';
|
|
2
2
|
import { useContext } from 'react';
|
|
3
|
-
import { useQueriesStore } from '
|
|
3
|
+
import { useQueriesStore } from './useQueriesStore';
|
|
4
4
|
|
|
5
5
|
export function useQueriesIsFetching(contextId?: number) {
|
|
6
6
|
const context = useContext(QueriesContext);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QueriesContext } from '
|
|
1
|
+
import { QueriesContext } from './QueriesContext';
|
|
2
2
|
import { useCallback, useContext } from 'react';
|
|
3
|
-
import { useQueriesStore } from '
|
|
3
|
+
import { useQueriesStore } from './useQueriesStore';
|
|
4
4
|
import { useQueryClient } from '@tanstack/react-query';
|
|
5
5
|
|
|
6
6
|
export function useQueriesReload(contextId?: number) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { QueriesContext } from '
|
|
1
|
+
import { QueriesContext } from './QueriesContext';
|
|
2
2
|
import { useClientLayoutEffect } from '@ainias42/react-bootstrap-mobile';
|
|
3
3
|
import { useContext, useRef } from 'react';
|
|
4
|
-
import { useQueriesStore } from '
|
|
4
|
+
import { useQueriesStore } from './useQueriesStore';
|
|
5
5
|
|
|
6
6
|
export function useQueriesSubscribeToReload(keys: string[], isFetching: boolean, error: any) {
|
|
7
7
|
const contextId = useContext(QueriesContext);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { QueriesContext } from '
|
|
1
|
+
import { QueriesContext } from './QueriesContext';
|
|
2
2
|
import { useContext } from 'react';
|
|
3
|
-
import { useQueriesStore } from '
|
|
3
|
+
import { useQueriesStore } from './useQueriesStore';
|
|
4
4
|
|
|
5
5
|
export function useScopedQueriesIsFetching(scope: { global: boolean; subContexts: boolean }, contextId?: number) {
|
|
6
6
|
const context = useContext(QueriesContext);
|
package/src/generateIdsQuery.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ArrayHelper, JsonHelper } from '@ainias42/js-helper';
|
|
2
|
-
import { NotFoundError } from '
|
|
2
|
+
import { NotFoundError } from './NotFoundError';
|
|
3
3
|
import { create, windowScheduler } from '@yornaath/batshit';
|
|
4
4
|
import { createInfiniteQuery, createQuery } from 'react-query-kit';
|
|
5
|
-
import { generateQuery } from '
|
|
5
|
+
import { generateQuery } from './generateQuery';
|
|
6
6
|
import { hashKey, useQueries, useQueryClient } from '@tanstack/react-query';
|
|
7
|
-
import { hoistReactQueryKitAttributes } from '
|
|
8
|
-
import { useIndexedData } from '
|
|
7
|
+
import { hoistReactQueryKitAttributes } from './hoistReactQueryKitAttributes';
|
|
8
|
+
import { useIndexedData } from './hooks/useIndexedData';
|
|
9
9
|
import { useMemo, useRef } from 'react';
|
|
10
|
-
import { useQueriesSubscribeToReload } from '
|
|
10
|
+
import { useQueriesSubscribeToReload } from './QueryContext/useQuerySubscribeToReload';
|
|
11
11
|
import type { Awaitable, Override, URecord } from '@ainias42/js-helper';
|
|
12
12
|
import type { CreateInfiniteQueryOptions, CreateQueryOptions, QueryHookOptions } from 'react-query-kit';
|
|
13
13
|
import type { QueriesResults } from '@tanstack/react-query/build/legacy/useQueries';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { generateIdsQuery } from '
|
|
1
|
+
import { generateIdsQuery } from './generateIdsQuery';
|
|
2
2
|
import { hashKey } from '@tanstack/react-query';
|
|
3
|
-
import { noop } from '
|
|
3
|
+
import { noop } from './noop';
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
|
-
import type { DeepPartial } from '
|
|
5
|
+
import type { DeepPartial } from './types/DeepPartial';
|
|
6
6
|
|
|
7
7
|
export function generateNestedIdQuery<
|
|
8
8
|
IdType extends number | string | symbol,
|
package/src/generateQuery.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createQuery } from 'react-query-kit';
|
|
2
2
|
import { hashKey } from '@tanstack/react-query';
|
|
3
|
-
import { hoistReactQueryKitAttributes } from '
|
|
4
|
-
import { useQueriesSubscribeToReload } from '
|
|
3
|
+
import { hoistReactQueryKitAttributes } from './hoistReactQueryKitAttributes';
|
|
4
|
+
import { useQueriesSubscribeToReload } from './QueryContext/useQuerySubscribeToReload';
|
|
5
5
|
import type { CreateQueryOptions, QueryHookResult } from 'react-query-kit';
|
|
6
6
|
|
|
7
7
|
export function generateQuery<
|
package/src/noop.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
"src/*"
|
|
11
|
-
],
|
|
12
|
-
"@cli/*": [
|
|
13
|
-
"cli/*"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"exclude": [
|
|
18
|
-
"../../node_modules",
|
|
19
|
-
"dist/**/*",
|
|
20
|
-
"dist/src/**/*"
|
|
21
|
-
],
|
|
22
|
-
"include": [
|
|
23
|
-
"src/**/*.tsx",
|
|
24
|
-
"src/**/*.ts"
|
|
25
|
-
]
|
|
2
|
+
"extends": "@ainias42/config/tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"jsx": "react",
|
|
5
|
+
"outDir": "./dist",
|
|
6
|
+
"declaration": true
|
|
7
|
+
},
|
|
8
|
+
"exclude": ["../../node_modules", "dist/**/*", "dist/src/**/*"],
|
|
9
|
+
"include": ["src/**/*.tsx", "src/**/*.ts"]
|
|
26
10
|
}
|