@hyper-fetch/react 7.5.2 → 8.0.0
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/.eslintrc.cjs +12 -0
- package/__tests__/features/helpers/use-request-events/use-request-events.base.spec.ts +115 -0
- package/__tests__/features/helpers/use-request-events/use-request-events.utils.spec.ts +69 -0
- package/__tests__/features/helpers/use-socket-state/use-socket-state.base.spec.ts +213 -0
- package/__tests__/features/helpers/use-tracked-state/use-tacked-state.actions.spec.ts +550 -0
- package/__tests__/features/helpers/use-tracked-state/use-tracked-state.base.spec.ts +566 -0
- package/__tests__/features/helpers/use-tracked-state/use-tracked-state.utils.spec.ts +260 -0
- package/__tests__/features/provider/provider.hydration.spec.tsx +165 -0
- package/__tests__/features/provider/use-config-provider.base.spec.tsx +69 -0
- package/__tests__/features/use-app-manager/use-app-manager.base.spec.ts +85 -0
- package/__tests__/features/use-cache/use-cache.base.spec.ts +136 -0
- package/__tests__/features/use-cache/use-cache.helpers.ts +40 -0
- package/__tests__/features/use-cache/use-cache.typescript.spec.ts +111 -0
- package/__tests__/features/use-emitter/use-emitter.base.spec.ts +124 -0
- package/__tests__/features/use-fetch/use-fetch.base.spec.ts +372 -0
- package/__tests__/features/use-fetch/use-fetch.cancel.spec.ts +83 -0
- package/__tests__/features/use-fetch/use-fetch.clear-state.spec.ts +82 -0
- package/__tests__/features/use-fetch/use-fetch.concurrency.spec.ts +91 -0
- package/__tests__/features/use-fetch/use-fetch.debounce.spec.ts +153 -0
- package/__tests__/features/use-fetch/use-fetch.deduplication.spec.ts +80 -0
- package/__tests__/features/use-fetch/use-fetch.infinite.ts +39 -0
- package/__tests__/features/use-fetch/use-fetch.integration.spec.tsx +172 -0
- package/__tests__/features/use-fetch/use-fetch.keep-previous-data.spec.ts +215 -0
- package/__tests__/features/use-fetch/use-fetch.methods.spec.ts +233 -0
- package/__tests__/features/use-fetch/use-fetch.offline.spec.ts +103 -0
- package/__tests__/features/use-fetch/use-fetch.pagination.ts +36 -0
- package/__tests__/features/use-fetch/use-fetch.prefetch.spec.tsx +73 -0
- package/__tests__/features/use-fetch/use-fetch.refresh.spec.ts +187 -0
- package/__tests__/features/use-fetch/use-fetch.rerender.spec.tsx +151 -0
- package/__tests__/features/use-fetch/use-fetch.retry.ts +38 -0
- package/__tests__/features/use-fetch/use-fetch.revalidate.spec.ts +237 -0
- package/__tests__/features/use-fetch/use-fetch.suspense.spec.tsx +505 -0
- package/__tests__/features/use-fetch/use-fetch.typescript.spec.ts +182 -0
- package/__tests__/features/use-fetch/use-fetch.utils.spec.ts +26 -0
- package/__tests__/features/use-fetch/use-fetch.window.spec.ts +131 -0
- package/__tests__/features/use-listener/use-listener.base.spec.ts +57 -0
- package/__tests__/features/use-queue/use-queue.actions.spec.ts +238 -0
- package/__tests__/features/use-queue/use-queue.base.spec.ts +367 -0
- package/__tests__/features/use-queue/use-queue.resolve.spec.ts +173 -0
- package/__tests__/features/use-stream/use-stream.base.spec.ts +481 -0
- package/__tests__/features/use-submit/use-submit.base.spec.ts +76 -0
- package/__tests__/features/use-submit/use-submit.cancel.spec.ts +46 -0
- package/__tests__/features/use-submit/use-submit.concurrency.spec.ts +62 -0
- package/__tests__/features/use-submit/use-submit.debounce.spec.ts +320 -0
- package/__tests__/features/use-submit/use-submit.methods.spec.ts +276 -0
- package/__tests__/features/use-submit/use-submit.optimistic.spec.ts +548 -0
- package/__tests__/features/use-submit/use-submit.queue.spec.ts +84 -0
- package/__tests__/features/use-submit/use-submit.retry.spec.ts +92 -0
- package/__tests__/features/use-submit/use-submit.revalidate.spec.ts +99 -0
- package/__tests__/features/use-submit/use-submit.submit.spec.ts +234 -0
- package/__tests__/features/use-submit/use-submit.typescript.spec.ts +325 -0
- package/__tests__/shared/index.ts +2 -0
- package/__tests__/shared/isolation.tests.ts +12 -0
- package/__tests__/shared/response.tests.ts +128 -0
- package/__tests__/tsconfig.json +27 -0
- package/__tests__/utils/cache.utils.ts +55 -0
- package/__tests__/utils/client.utils.ts +3 -0
- package/__tests__/utils/emitter.utils.ts +8 -0
- package/__tests__/utils/helpers.utils.ts +9 -0
- package/__tests__/utils/index.ts +14 -0
- package/__tests__/utils/listener.utils.ts +11 -0
- package/__tests__/utils/request.utils.ts +12 -0
- package/__tests__/utils/state.utils.ts +7 -0
- package/__tests__/utils/use-app-manager.utils.ts +10 -0
- package/__tests__/utils/use-cache.utils.ts +12 -0
- package/__tests__/utils/use-emitter.utils.ts +12 -0
- package/__tests__/utils/use-fetch.utils.ts +12 -0
- package/__tests__/utils/use-listener.utils.ts +12 -0
- package/__tests__/utils/use-queue.utils.ts +70 -0
- package/__tests__/utils/use-request-events.utils.ts +43 -0
- package/__tests__/utils/use-socket-state.utils.ts +12 -0
- package/__tests__/utils/use-submit.utils.ts +12 -0
- package/__tests__/utils/use-tracked-state.utils.ts +27 -0
- package/__tests__/vitest.setup.ts +8 -0
- package/dist/helpers/index.d.ts +4 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/use-request-events/index.d.ts +3 -0
- package/dist/helpers/use-request-events/index.d.ts.map +1 -0
- package/dist/helpers/use-request-events/use-request-events.hooks.d.ts +10 -0
- package/dist/helpers/use-request-events/use-request-events.hooks.d.ts.map +1 -0
- package/dist/helpers/use-request-events/use-request-events.types.d.ts +78 -0
- package/dist/helpers/use-request-events/use-request-events.types.d.ts.map +1 -0
- package/dist/helpers/use-socket-state/index.d.ts +4 -0
- package/dist/helpers/use-socket-state/index.d.ts.map +1 -0
- package/dist/helpers/use-socket-state/use-socket-state.constants.d.ts +4 -0
- package/dist/helpers/use-socket-state/use-socket-state.constants.d.ts.map +1 -0
- package/dist/helpers/use-socket-state/use-socket-state.hooks.d.ts +24 -0
- package/dist/helpers/use-socket-state/use-socket-state.hooks.d.ts.map +1 -0
- package/dist/helpers/use-socket-state/use-socket-state.types.d.ts +12 -0
- package/dist/helpers/use-socket-state/use-socket-state.types.d.ts.map +1 -0
- package/dist/helpers/use-tracked-state/index.d.ts +5 -0
- package/dist/helpers/use-tracked-state/index.d.ts.map +1 -0
- package/dist/helpers/use-tracked-state/use-tracked-state.constants.d.ts +3 -0
- package/dist/helpers/use-tracked-state/use-tracked-state.constants.d.ts.map +1 -0
- package/dist/helpers/use-tracked-state/use-tracked-state.hooks.d.ts +12 -0
- package/dist/helpers/use-tracked-state/use-tracked-state.hooks.d.ts.map +1 -0
- package/dist/helpers/use-tracked-state/use-tracked-state.types.d.ts +113 -0
- package/dist/helpers/use-tracked-state/use-tracked-state.types.d.ts.map +1 -0
- package/dist/helpers/use-tracked-state/use-tracked-state.utils.d.ts +29 -0
- package/dist/helpers/use-tracked-state/use-tracked-state.utils.d.ts.map +1 -0
- package/dist/hooks/use-app-manager/index.d.ts +3 -0
- package/dist/hooks/use-app-manager/index.d.ts.map +1 -0
- package/dist/hooks/use-app-manager/use-app-manager.hooks.d.ts +4 -0
- package/dist/hooks/use-app-manager/use-app-manager.hooks.d.ts.map +1 -0
- package/dist/hooks/use-app-manager/use-app-manager.types.d.ts +19 -0
- package/dist/hooks/use-app-manager/use-app-manager.types.d.ts.map +1 -0
- package/dist/hooks/use-cache/index.d.ts +4 -0
- package/dist/hooks/use-cache/index.d.ts.map +1 -0
- package/dist/hooks/use-cache/use-cache.constants.d.ts +6 -0
- package/dist/hooks/use-cache/use-cache.constants.d.ts.map +1 -0
- package/dist/hooks/use-cache/use-cache.hooks.d.ts +4 -0
- package/dist/hooks/use-cache/use-cache.hooks.d.ts.map +1 -0
- package/dist/hooks/use-cache/use-cache.types.d.ts +24 -0
- package/dist/hooks/use-cache/use-cache.types.d.ts.map +1 -0
- package/dist/hooks/use-emitter/index.d.ts +3 -0
- package/dist/hooks/use-emitter/index.d.ts.map +1 -0
- package/dist/hooks/use-emitter/use-emitter.hooks.d.ts +26 -0
- package/dist/hooks/use-emitter/use-emitter.hooks.d.ts.map +1 -0
- package/dist/hooks/use-emitter/use-emitter.types.d.ts +4 -0
- package/dist/hooks/use-emitter/use-emitter.types.d.ts.map +1 -0
- package/dist/hooks/use-fetch/index.d.ts +5 -0
- package/dist/hooks/use-fetch/index.d.ts.map +1 -0
- package/dist/hooks/use-fetch/use-fetch.constants.d.ts +8 -0
- package/dist/hooks/use-fetch/use-fetch.constants.d.ts.map +1 -0
- package/dist/hooks/use-fetch/use-fetch.hooks.d.ts +10 -0
- package/dist/hooks/use-fetch/use-fetch.hooks.d.ts.map +1 -0
- package/dist/hooks/use-fetch/use-fetch.types.d.ts +118 -0
- package/dist/hooks/use-fetch/use-fetch.types.d.ts.map +1 -0
- package/dist/hooks/use-fetch/use-fetch.utils.d.ts +2 -0
- package/dist/hooks/use-fetch/use-fetch.utils.d.ts.map +1 -0
- package/dist/hooks/use-listener/index.d.ts +3 -0
- package/dist/hooks/use-listener/index.d.ts.map +1 -0
- package/dist/hooks/use-listener/use-listener.hooks.d.ts +31 -0
- package/dist/hooks/use-listener/use-listener.hooks.d.ts.map +1 -0
- package/dist/hooks/use-listener/use-listener.types.d.ts +4 -0
- package/dist/hooks/use-listener/use-listener.types.d.ts.map +1 -0
- package/dist/hooks/use-queue/index.d.ts +4 -0
- package/dist/hooks/use-queue/index.d.ts.map +1 -0
- package/dist/hooks/use-queue/use-queue.constants.d.ts +4 -0
- package/dist/hooks/use-queue/use-queue.constants.d.ts.map +1 -0
- package/dist/hooks/use-queue/use-queue.hooks.d.ts +10 -0
- package/dist/hooks/use-queue/use-queue.hooks.d.ts.map +1 -0
- package/dist/hooks/use-queue/use-queue.types.d.ts +58 -0
- package/dist/hooks/use-queue/use-queue.types.d.ts.map +1 -0
- package/dist/hooks/use-stream/index.d.ts +3 -0
- package/dist/hooks/use-stream/index.d.ts.map +1 -0
- package/dist/hooks/use-stream/use-stream.hooks.d.ts +11 -0
- package/dist/hooks/use-stream/use-stream.hooks.d.ts.map +1 -0
- package/dist/hooks/use-stream/use-stream.types.d.ts +52 -0
- package/dist/hooks/use-stream/use-stream.types.d.ts.map +1 -0
- package/dist/hooks/use-submit/index.d.ts +4 -0
- package/dist/hooks/use-submit/index.d.ts.map +1 -0
- package/dist/hooks/use-submit/use-submit.constants.d.ts +8 -0
- package/dist/hooks/use-submit/use-submit.constants.d.ts.map +1 -0
- package/dist/hooks/use-submit/use-submit.hooks.d.ts +10 -0
- package/dist/hooks/use-submit/use-submit.hooks.d.ts.map +1 -0
- package/dist/hooks/use-submit/use-submit.types.d.ts +115 -0
- package/dist/hooks/use-submit/use-submit.types.d.ts.map +1 -0
- package/dist/index.d.ts +12 -733
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1935 -0
- package/dist/index.mjs.map +1 -0
- package/dist/provider/index.d.ts +3 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/provider.d.ts +13 -0
- package/dist/provider/provider.d.ts.map +1 -0
- package/dist/provider/provider.types.d.ts +31 -0
- package/dist/provider/provider.types.d.ts.map +1 -0
- package/dist/utils/bounce.utils.d.ts +8 -0
- package/dist/utils/bounce.utils.d.ts.map +1 -0
- package/dist/utils/deep-equal.utils.d.ts +14 -0
- package/dist/utils/deep-equal.utils.d.ts.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/tracked-proxy.utils.d.ts +7 -0
- package/dist/utils/tracked-proxy.utils.d.ts.map +1 -0
- package/package.json +21 -13
- package/project.json +4 -0
- package/src/helpers/use-request-events/use-request-events.hooks.ts +60 -14
- package/src/helpers/use-request-events/use-request-events.types.ts +19 -12
- package/src/helpers/use-socket-state/use-socket-state.constants.ts +2 -2
- package/src/helpers/use-socket-state/use-socket-state.hooks.ts +47 -13
- package/src/helpers/use-socket-state/use-socket-state.types.ts +1 -1
- package/src/helpers/use-tracked-state/use-tracked-state.constants.ts +1 -1
- package/src/helpers/use-tracked-state/use-tracked-state.hooks.ts +74 -22
- package/src/helpers/use-tracked-state/use-tracked-state.types.ts +7 -2
- package/src/helpers/use-tracked-state/use-tracked-state.utils.ts +39 -4
- package/src/hooks/use-app-manager/use-app-manager.hooks.ts +2 -2
- package/src/hooks/use-cache/use-cache.hooks.ts +33 -41
- package/src/hooks/use-cache/use-cache.types.ts +3 -3
- package/src/hooks/use-emitter/use-emitter.hooks.ts +17 -16
- package/src/hooks/use-fetch/use-fetch.constants.ts +5 -2
- package/src/hooks/use-fetch/use-fetch.hooks.ts +109 -51
- package/src/hooks/use-fetch/use-fetch.types.ts +18 -3
- package/src/hooks/use-listener/use-listener.hooks.ts +19 -27
- package/src/hooks/use-queue/use-queue.constants.ts +2 -2
- package/src/hooks/use-queue/use-queue.hooks.ts +25 -6
- package/src/hooks/use-queue/use-queue.types.ts +8 -2
- package/src/hooks/use-stream/index.ts +2 -0
- package/src/hooks/use-stream/use-stream.hooks.ts +164 -0
- package/src/hooks/use-stream/use-stream.types.ts +53 -0
- package/src/hooks/use-submit/use-submit.constants.ts +2 -2
- package/src/hooks/use-submit/use-submit.hooks.ts +43 -48
- package/src/hooks/use-submit/use-submit.types.ts +9 -9
- package/src/index.ts +1 -0
- package/src/provider/provider.tsx +1 -1
- package/src/provider/provider.types.ts +8 -8
- package/src/utils/index.ts +1 -0
- package/src/utils/tracked-proxy.utils.ts +19 -0
- package/tsconfig.json +1 -1
- package/vite.config.ts +45 -0
- package/.eslintrc.json +0 -11
- package/dist/index.js +0 -1541
- package/dist/index.js.map +0 -7
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RequestInstance } from "@hyper-fetch/core";
|
|
2
|
+
import { renderHook } from "@testing-library/react";
|
|
3
|
+
|
|
4
|
+
import type { UseFetchOptionsType } from "hooks/use-fetch";
|
|
5
|
+
import { useFetch } from "hooks/use-fetch";
|
|
6
|
+
|
|
7
|
+
export const renderUseFetch = <T extends RequestInstance>(request: T, options?: UseFetchOptionsType<T>) => {
|
|
8
|
+
return renderHook((rerenderOptions: UseFetchOptionsType<RequestInstance> & { request?: RequestInstance }) => {
|
|
9
|
+
const { request: req, ...rest } = rerenderOptions || {};
|
|
10
|
+
return useFetch(req || request, { dependencyTracking: false, ...options, ...rest } as UseFetchOptionsType<T>);
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { renderHook } from "@testing-library/react";
|
|
2
|
+
import type { ListenerInstance } from "@hyper-fetch/sockets";
|
|
3
|
+
|
|
4
|
+
import type { UseListenerOptionsType } from "hooks/use-listener";
|
|
5
|
+
import { useListener } from "hooks/use-listener";
|
|
6
|
+
|
|
7
|
+
export const renderUseListener = <T extends ListenerInstance>(listener: T, options?: UseListenerOptionsType) => {
|
|
8
|
+
return renderHook((rerenderOptions: UseListenerOptionsType & { listener?: ListenerInstance }) => {
|
|
9
|
+
const { listener: lst, ...rest } = rerenderOptions || {};
|
|
10
|
+
return useListener(lst || listener, { dependencyTracking: false, ...options, ...rest });
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { renderHook } from "@testing-library/react";
|
|
2
|
+
import type { RequestInstance } from "@hyper-fetch/core";
|
|
3
|
+
import { getRequestDispatcher, getProgressData } from "@hyper-fetch/core";
|
|
4
|
+
|
|
5
|
+
import type { UseQueueOptionsType } from "hooks/use-queue";
|
|
6
|
+
import { useQueue } from "hooks/use-queue";
|
|
7
|
+
|
|
8
|
+
export const renderUseQueue = <T extends RequestInstance>(request: T, options?: UseQueueOptionsType) => {
|
|
9
|
+
return renderHook((rerenderOptions: UseQueueOptionsType & { request?: RequestInstance }) => {
|
|
10
|
+
const { request: cmd, ...rest } = rerenderOptions || {};
|
|
11
|
+
return useQueue(cmd || request, { ...options, ...rest });
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const addQueueElement = <T extends RequestInstance>(
|
|
16
|
+
request: T,
|
|
17
|
+
options?: {
|
|
18
|
+
stop: boolean;
|
|
19
|
+
dispatcherType?: "fetch" | "submit" | "auto";
|
|
20
|
+
},
|
|
21
|
+
) => {
|
|
22
|
+
const { stop = false, dispatcherType = "auto" } = options || {};
|
|
23
|
+
const [dispatcher] = getRequestDispatcher(request, dispatcherType);
|
|
24
|
+
if (stop) dispatcher.stop(request.queryKey);
|
|
25
|
+
return dispatcher.add(request);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const emitDownloadProgress = <T extends RequestInstance>(
|
|
29
|
+
requestId: string,
|
|
30
|
+
request: T,
|
|
31
|
+
options?: {
|
|
32
|
+
total: number;
|
|
33
|
+
loaded: number;
|
|
34
|
+
},
|
|
35
|
+
) => {
|
|
36
|
+
const values = options || { total: 50, loaded: 25 };
|
|
37
|
+
const startTimestamp = new Date(+new Date() - 20000);
|
|
38
|
+
const progressTimestamp = new Date();
|
|
39
|
+
|
|
40
|
+
const progress = getProgressData(startTimestamp, progressTimestamp, values);
|
|
41
|
+
request.client.requestManager.events.emitDownloadProgress({
|
|
42
|
+
...progress,
|
|
43
|
+
requestId,
|
|
44
|
+
request,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return [startTimestamp, progressTimestamp];
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const emitUploadProgress = <T extends RequestInstance>(
|
|
51
|
+
requestId: string,
|
|
52
|
+
request: T,
|
|
53
|
+
options?: {
|
|
54
|
+
total: number;
|
|
55
|
+
loaded: number;
|
|
56
|
+
},
|
|
57
|
+
) => {
|
|
58
|
+
const values = options || { total: 50, loaded: 25 };
|
|
59
|
+
const startTimestamp = new Date(+new Date() - 20000);
|
|
60
|
+
const progressTimestamp = new Date();
|
|
61
|
+
|
|
62
|
+
const progress = getProgressData(startTimestamp, progressTimestamp, values);
|
|
63
|
+
request.client.requestManager.events.emitUploadProgress({
|
|
64
|
+
...progress,
|
|
65
|
+
requestId,
|
|
66
|
+
request,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
return [startTimestamp, progressTimestamp];
|
|
70
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { RequestInstance } from "@hyper-fetch/core";
|
|
2
|
+
import { renderHook } from "@testing-library/react";
|
|
3
|
+
|
|
4
|
+
import type { UseRequestEventsPropsType, UseTrackedStateProps } from "helpers";
|
|
5
|
+
import { useTrackedState, useRequestEvents } from "helpers";
|
|
6
|
+
import { isEqual } from "utils";
|
|
7
|
+
|
|
8
|
+
export const renderUseRequestEvents = <Request extends RequestInstance>(
|
|
9
|
+
request: Request,
|
|
10
|
+
options?: Partial<UseRequestEventsPropsType<Request>>,
|
|
11
|
+
trackedOptions?: Partial<UseTrackedStateProps<Request>>,
|
|
12
|
+
) => {
|
|
13
|
+
const { client } = request;
|
|
14
|
+
const { fetchDispatcher: dispatcher, loggerManager } = client;
|
|
15
|
+
|
|
16
|
+
const logger = loggerManager.initialize(client, "test");
|
|
17
|
+
|
|
18
|
+
const { result } = renderHook(() => {
|
|
19
|
+
return useTrackedState({
|
|
20
|
+
logger,
|
|
21
|
+
request,
|
|
22
|
+
dispatcher,
|
|
23
|
+
initialResponse: null,
|
|
24
|
+
deepCompare: isEqual,
|
|
25
|
+
dependencyTracking: false,
|
|
26
|
+
...trackedOptions,
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
const [, actions, { setCacheData, getIsDataProcessing }] = result.current;
|
|
30
|
+
|
|
31
|
+
return renderHook((args?: Partial<Parameters<typeof useRequestEvents>[0]>) => {
|
|
32
|
+
return useRequestEvents({
|
|
33
|
+
logger,
|
|
34
|
+
actions,
|
|
35
|
+
dispatcher,
|
|
36
|
+
setCacheData,
|
|
37
|
+
getIsDataProcessing,
|
|
38
|
+
...options,
|
|
39
|
+
...args,
|
|
40
|
+
request,
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Mock } from "vitest";
|
|
2
|
+
import type { Socket } from "@hyper-fetch/sockets";
|
|
3
|
+
import { renderHook } from "@testing-library/react";
|
|
4
|
+
|
|
5
|
+
import { useSocketState } from "helpers";
|
|
6
|
+
|
|
7
|
+
export const renderUseSocketState = (socket: Socket, { onRender }: { onRender?: Mock } = {}) => {
|
|
8
|
+
return renderHook(() => {
|
|
9
|
+
onRender?.();
|
|
10
|
+
return useSocketState(socket, { dependencyTracking: true });
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RequestInstance } from "@hyper-fetch/core";
|
|
2
|
+
import { renderHook } from "@testing-library/react";
|
|
3
|
+
|
|
4
|
+
import type { UseSubmitOptionsType } from "hooks/use-submit";
|
|
5
|
+
import { useSubmit } from "hooks/use-submit";
|
|
6
|
+
|
|
7
|
+
export const renderUseSubmit = <T extends RequestInstance>(request: T, options?: UseSubmitOptionsType<T>) => {
|
|
8
|
+
return renderHook((rerenderOptions: UseSubmitOptionsType<T> & { request?: T }) => {
|
|
9
|
+
const { request: cmd, ...rest } = rerenderOptions || {};
|
|
10
|
+
return useSubmit(cmd || request, { dependencyTracking: false, ...options, ...rest });
|
|
11
|
+
});
|
|
12
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RequestInstance } from "@hyper-fetch/core";
|
|
2
|
+
import { renderHook } from "@testing-library/react";
|
|
3
|
+
|
|
4
|
+
import type { UseTrackedStateProps } from "helpers";
|
|
5
|
+
import { useTrackedState } from "helpers";
|
|
6
|
+
import { isEqual } from "utils";
|
|
7
|
+
|
|
8
|
+
export const renderUseTrackedState = <Request extends RequestInstance>(
|
|
9
|
+
request: Request,
|
|
10
|
+
options?: Partial<UseTrackedStateProps<Request>>,
|
|
11
|
+
) => {
|
|
12
|
+
const { client } = request;
|
|
13
|
+
const { fetchDispatcher: dispatcher, loggerManager } = client;
|
|
14
|
+
|
|
15
|
+
const logger = loggerManager.initialize(client, "test");
|
|
16
|
+
return renderHook(() => {
|
|
17
|
+
return useTrackedState({
|
|
18
|
+
logger,
|
|
19
|
+
request,
|
|
20
|
+
dispatcher,
|
|
21
|
+
initialResponse: null,
|
|
22
|
+
deepCompare: isEqual,
|
|
23
|
+
dependencyTracking: false,
|
|
24
|
+
...options,
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/use-request-events/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RequestInstance } from '@hyper-fetch/core';
|
|
2
|
+
import { UseRequestEventsReturnType, UseRequestEventsPropsType } from '..';
|
|
3
|
+
/**
|
|
4
|
+
* This is helper hook that handles main Hyper-Fetch event/data flow
|
|
5
|
+
* @internal
|
|
6
|
+
* @param options
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare const useRequestEvents: <R extends RequestInstance>({ request, dispatcher, logger, actions, setCacheData, getIsDataProcessing, }: UseRequestEventsPropsType<R>) => UseRequestEventsReturnType<R>;
|
|
10
|
+
//# sourceMappingURL=use-request-events.hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-request-events.hooks.d.ts","sourceRoot":"","sources":["../../../src/helpers/use-request-events/use-request-events.hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,eAAe,EAQhB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAOV,0BAA0B,EAC1B,yBAAyB,EAE1B,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,eAAe,EAAE,8EAOzD,yBAAyB,CAAC,CAAC,CAAC,KAAG,0BAA0B,CAAC,CAAC,CA+T7D,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Dispatcher, ExtractErrorType, CacheValueType, ExtractResponseType, ExtractMutationContextType, LoggerMethods, OptimisticCallbackResult, RequestEventType, RequestInstance, RequestProgressEventType, RequestResponseEventType, ResponseErrorType, ExtractAdapterType, ResponseType, ResponseSuccessType } from '@hyper-fetch/core';
|
|
2
|
+
import { UseTrackedStateActions } from '..';
|
|
3
|
+
export type UseRequestEventsDataMap = {
|
|
4
|
+
unmount: VoidFunction;
|
|
5
|
+
};
|
|
6
|
+
export type UseRequestEventsLifecycleMap = Map<string, {
|
|
7
|
+
unmount: VoidFunction;
|
|
8
|
+
}>;
|
|
9
|
+
export type UseRequestEventsPropsType<T extends RequestInstance> = {
|
|
10
|
+
request: T;
|
|
11
|
+
dispatcher: Dispatcher<ExtractAdapterType<T>>;
|
|
12
|
+
logger: LoggerMethods;
|
|
13
|
+
actions: UseTrackedStateActions<T>;
|
|
14
|
+
setCacheData: (cacheData: CacheValueType<ExtractResponseType<T>, ExtractErrorType<T>>) => void;
|
|
15
|
+
getIsDataProcessing: (cacheKey: string) => boolean;
|
|
16
|
+
};
|
|
17
|
+
export type UseRequestEventsActionsType<T extends RequestInstance> = {
|
|
18
|
+
/**
|
|
19
|
+
* Callback that allows canceling ongoing requests from the given queryKey.
|
|
20
|
+
*/
|
|
21
|
+
abort: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Helper hook listening on success response. Includes `mutationContext` when `setOptimistic` is configured.
|
|
24
|
+
*/
|
|
25
|
+
onSuccess: (callback: OnSuccessCallbackType<T>) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Helper hook listening on error response. Includes `mutationContext` when `setOptimistic` is configured.
|
|
28
|
+
*/
|
|
29
|
+
onError: (callback: OnErrorCallbackType<T>) => void;
|
|
30
|
+
/**
|
|
31
|
+
* Helper hook listening on aborting of requests. Includes `mutationContext` when `setOptimistic` is configured.
|
|
32
|
+
*/
|
|
33
|
+
onAbort: (callback: OnErrorCallbackType<T>) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Helper hook listening on request going into offline awaiting for network connection to be restored.
|
|
36
|
+
*/
|
|
37
|
+
onOfflineError: (callback: OnErrorCallbackType<T>) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Helper hook listening on any response. Includes `mutationContext` when `setOptimistic` is configured.
|
|
40
|
+
*/
|
|
41
|
+
onFinished: (callback: OnFinishedCallbackType<T>) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Helper hook listening on request start.
|
|
44
|
+
*/
|
|
45
|
+
onRequestStart: (callback: OnStartCallbackType<T>) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Helper hook listening on response start(before we receive all data from server).
|
|
48
|
+
*/
|
|
49
|
+
onResponseStart: (callback: OnStartCallbackType<T>) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Helper hook listening on download progress ETA.
|
|
52
|
+
*/
|
|
53
|
+
onDownloadProgress: (callback: OnProgressCallbackType) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Helper hook listening on upload progress ETA.
|
|
56
|
+
*/
|
|
57
|
+
onUploadProgress: (callback: OnProgressCallbackType) => void;
|
|
58
|
+
};
|
|
59
|
+
export type UseRequestEventsReturnType<T extends RequestInstance> = [
|
|
60
|
+
UseRequestEventsActionsType<T>,
|
|
61
|
+
{
|
|
62
|
+
addCacheDataListener: (request: T) => VoidFunction;
|
|
63
|
+
clearCacheDataListener: VoidFunction;
|
|
64
|
+
addLifecycleListeners: (request: T, requestId?: string, optimisticResult?: OptimisticCallbackResult<any>) => VoidFunction;
|
|
65
|
+
removeLifecycleListener: (requestId: string) => void;
|
|
66
|
+
clearLifecycleListeners: () => void;
|
|
67
|
+
}
|
|
68
|
+
];
|
|
69
|
+
export type CallbackParameters<Request extends RequestInstance, Resp> = {
|
|
70
|
+
response: Resp;
|
|
71
|
+
mutationContext: ExtractMutationContextType<Request> | undefined;
|
|
72
|
+
} & Omit<RequestResponseEventType<Request>, "response">;
|
|
73
|
+
export type OnSuccessCallbackType<Request extends RequestInstance> = (params: CallbackParameters<Request, ResponseSuccessType<ExtractResponseType<Request>, ExtractAdapterType<Request>>>) => void | Promise<void>;
|
|
74
|
+
export type OnErrorCallbackType<Request extends RequestInstance> = (params: CallbackParameters<Request, ResponseErrorType<ExtractErrorType<Request>, ExtractAdapterType<Request>>>) => void | Promise<void>;
|
|
75
|
+
export type OnFinishedCallbackType<Request extends RequestInstance> = (params: CallbackParameters<Request, ResponseType<ExtractResponseType<Request>, ExtractErrorType<Request>, ExtractAdapterType<Request>>>) => void | Promise<void>;
|
|
76
|
+
export type OnStartCallbackType<Request extends RequestInstance> = (data: RequestEventType<Request>) => void | Promise<void>;
|
|
77
|
+
export type OnProgressCallbackType = <Request extends RequestInstance>(data: RequestProgressEventType<Request>) => void | Promise<void>;
|
|
78
|
+
//# sourceMappingURL=use-request-events.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-request-events.types.d.ts","sourceRoot":"","sources":["../../../src/helpers/use-request-events/use-request-events.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,0BAA0B,EAC1B,aAAa,EACb,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAGtD,MAAM,MAAM,uBAAuB,GAAG;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC;AAChE,MAAM,MAAM,4BAA4B,GAAG,GAAG,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC;AAGlF,MAAM,MAAM,yBAAyB,CAAC,CAAC,SAAS,eAAe,IAAI;IACjE,OAAO,EAAE,CAAC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AC1B,MAAM,MAAM,sBAAsB,CAAC,OAAO,SAAS,eAAe,IAAI,CACpE,MAAM,EAAE,kBAAkB,CACxB,OAAO,EACP,YAAY,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC,CACnG,KACE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1B,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,eAAe,IAAI,CACjE,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,KAC5B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAC1B,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,SAAS,eAAe,EACnE,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,KACpC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/use-socket-state/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-socket-state.constants.d.ts","sourceRoot":"","sources":["../../../src/helpers/use-socket-state/use-socket-state.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,eAAO,MAAM,kBAAkB,EAAE,kBAAkB,CAAC,cAAc,CAMjE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SocketInstance, ExtractSocketExtraType } from '@hyper-fetch/sockets';
|
|
2
|
+
import { UseSocketStateType, UseSocketStateProps } from '..';
|
|
3
|
+
export declare const useSocketState: <DataType, Socket extends SocketInstance>(socket: Socket, { dependencyTracking }: UseSocketStateProps) => readonly [UseSocketStateType<Socket, DataType>, {
|
|
4
|
+
setData: (data: DataType | null) => void;
|
|
5
|
+
setExtra: (extra: ExtractSocketExtraType<Socket> | null) => void;
|
|
6
|
+
setConnected: (connected: boolean) => void;
|
|
7
|
+
setConnecting: (connecting: boolean) => void;
|
|
8
|
+
setTimestamp: (timestamp: number | null) => void;
|
|
9
|
+
clearState: () => void;
|
|
10
|
+
}, {
|
|
11
|
+
onConnected: (callback: VoidFunction) => void;
|
|
12
|
+
onDisconnected: (callback: VoidFunction) => void;
|
|
13
|
+
onError: <ErrorType = Event>(callback: (event: ErrorType) => void) => void;
|
|
14
|
+
onConnecting: (callback: VoidFunction) => void;
|
|
15
|
+
onReconnecting: (callback: (data: {
|
|
16
|
+
attempts: number;
|
|
17
|
+
}) => void) => void;
|
|
18
|
+
onReconnectingFailed: (callback: (data: {
|
|
19
|
+
attempts: number;
|
|
20
|
+
}) => void) => void;
|
|
21
|
+
}, {
|
|
22
|
+
readonly setRenderKey: (renderKey: keyof UseSocketStateType<Socket, DataType>) => void;
|
|
23
|
+
}];
|
|
24
|
+
//# sourceMappingURL=use-socket-state.hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-socket-state.hooks.d.ts","sourceRoot":"","sources":["../../../src/helpers/use-socket-state/use-socket-state.hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAInF,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEvE,eAAO,MAAM,cAAc,GAAI,QAAQ,EAAE,MAAM,SAAS,cAAc,EACpE,QAAQ,MAAM,EACd,wBAAwB,mBAAmB;oBA+EzB,QAAQ,GAAG,IAAI;sBAIb,sBAAsB,CAAC,MAAM,CAAC,GAAG,IAAI;8BAI7B,OAAO;gCAIL,OAAO;8BAIT,MAAM,GAAG,IAAI;;;4BAiBf,YAAY;+BAGT,YAAY;cAG7B,SAAS,oBAAoB,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI;6BAGxC,YAAY;+BAGV,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;qCAG9B,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;;uCA7EtC,MAAM,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC;EAwH5E,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ExtractSocketExtraType, SocketInstance } from '@hyper-fetch/sockets';
|
|
2
|
+
export type UseSocketStateType<Socket extends SocketInstance, DataType = any> = {
|
|
3
|
+
data: DataType | null;
|
|
4
|
+
extra: ExtractSocketExtraType<Socket> | null;
|
|
5
|
+
connected: boolean;
|
|
6
|
+
connecting: boolean;
|
|
7
|
+
timestamp: number | null;
|
|
8
|
+
};
|
|
9
|
+
export type UseSocketStateProps = {
|
|
10
|
+
dependencyTracking?: boolean;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=use-socket-state.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-socket-state.types.d.ts","sourceRoot":"","sources":["../../../src/helpers/use-socket-state/use-socket-state.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEnF,MAAM,MAAM,kBAAkB,CAAC,MAAM,SAAS,cAAc,EAAE,QAAQ,GAAG,GAAG,IAAI;IAC9E,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,sBAAsB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAC7C,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/use-tracked-state/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tracked-state.constants.d.ts","sourceRoot":"","sources":["../../../src/helpers/use-tracked-state/use-tracked-state.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,eAAO,MAAM,YAAY,EAAE,mBAU1B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RequestInstance } from '@hyper-fetch/core';
|
|
2
|
+
import { UseTrackedStateProps, UseTrackedStateReturn } from './use-tracked-state.types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param request
|
|
6
|
+
* @param initialResponse
|
|
7
|
+
* @param dispatcher
|
|
8
|
+
* @param dependencies
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare const useTrackedState: <T extends RequestInstance>({ request, dispatcher, initialResponse, deepCompare, dependencyTracking, keepPreviousData, disabled, revalidate, }: UseTrackedStateProps<T>) => UseTrackedStateReturn<T>;
|
|
12
|
+
//# sourceMappingURL=use-tracked-state.hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tracked-state.hooks.d.ts","sourceRoot":"","sources":["../../../src/helpers/use-tracked-state/use-tracked-state.hooks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,eAAe,EAIhB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAGV,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AASnC;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,eAAe,EAAE,oHASxD,oBAAoB,CAAC,CAAC,CAAC,KAAG,qBAAqB,CAAC,CAAC,CA6RnD,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Dispatcher, ExtractErrorType, CacheValueType, ExtractResponseType, RequestInstance, ExtractAdapterType, ExtractAdapterStatusType, ExtractAdapterExtraType, ExtractAdapterResolvedType, NullableType, CacheSetState, LoggerMethods } from '@hyper-fetch/core';
|
|
2
|
+
import { isEqual } from '../../utils';
|
|
3
|
+
export type UseTrackedStateProps<T extends RequestInstance> = {
|
|
4
|
+
request: T;
|
|
5
|
+
logger: LoggerMethods;
|
|
6
|
+
initialResponse: NullableType<Partial<ExtractAdapterResolvedType<T>>>;
|
|
7
|
+
dispatcher: Dispatcher<ExtractAdapterType<T>>;
|
|
8
|
+
dependencyTracking: boolean;
|
|
9
|
+
deepCompare: boolean | typeof isEqual;
|
|
10
|
+
keepPreviousData?: "auto" | "preserve" | "clean";
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
revalidate?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type UseTrackedStateReturn<T extends RequestInstance> = [
|
|
15
|
+
UseTrackedStateType<T>,
|
|
16
|
+
UseTrackedStateActions<T>,
|
|
17
|
+
{
|
|
18
|
+
setRenderKey: (renderKey: keyof UseTrackedStateType<T>) => void;
|
|
19
|
+
setCacheData: (cacheData: CacheValueType<ExtractResponseType<T>, ExtractErrorType<T>>) => void;
|
|
20
|
+
getStaleStatus: () => boolean;
|
|
21
|
+
getIsDataProcessing: (cacheKey: string) => boolean;
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
export type UseTrackedStateType<T extends RequestInstance = RequestInstance> = {
|
|
25
|
+
/**
|
|
26
|
+
* Request response data
|
|
27
|
+
*/
|
|
28
|
+
data: null | ExtractResponseType<T>;
|
|
29
|
+
/**
|
|
30
|
+
* Request response error
|
|
31
|
+
*/
|
|
32
|
+
error: null | ExtractErrorType<T>;
|
|
33
|
+
/**
|
|
34
|
+
* Request loading state
|
|
35
|
+
*/
|
|
36
|
+
loading: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Request status
|
|
39
|
+
*/
|
|
40
|
+
status: null | ExtractAdapterStatusType<ExtractAdapterType<T>> | null;
|
|
41
|
+
/**
|
|
42
|
+
* Request additional response data
|
|
43
|
+
*/
|
|
44
|
+
extra: null | ExtractAdapterExtraType<ExtractAdapterType<T>>;
|
|
45
|
+
/**
|
|
46
|
+
* Information whether request succeeded
|
|
47
|
+
*/
|
|
48
|
+
success: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Request attempts
|
|
51
|
+
*/
|
|
52
|
+
retries: number;
|
|
53
|
+
/**
|
|
54
|
+
* Request response timestamp
|
|
55
|
+
*/
|
|
56
|
+
responseTimestamp: null | Date;
|
|
57
|
+
/**
|
|
58
|
+
* Request response timestamp
|
|
59
|
+
*/
|
|
60
|
+
requestTimestamp: null | Date;
|
|
61
|
+
};
|
|
62
|
+
export type UseTrackedStateActions<T extends RequestInstance> = {
|
|
63
|
+
/**
|
|
64
|
+
* Action to set custom data. We can do it locally(inside hook state).
|
|
65
|
+
* If you need to update cache data use client.cache.update(). method.
|
|
66
|
+
*/
|
|
67
|
+
setData: (data: CacheSetState<ExtractResponseType<T> | null>) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Action to set custom error. We can do it locally(inside hook state).
|
|
70
|
+
* If you need to update cache data use client.cache.update() method.
|
|
71
|
+
*/
|
|
72
|
+
setError: (error: CacheSetState<ExtractErrorType<T> | null>) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Action to set custom loading. We can do it locally(inside hook state).
|
|
75
|
+
* If you need to update cache data use client.cache.update() method.
|
|
76
|
+
*/
|
|
77
|
+
setLoading: (loading: CacheSetState<boolean>) => void;
|
|
78
|
+
/**
|
|
79
|
+
* Action to set custom status. We can do it locally(inside hook state).
|
|
80
|
+
* If you need to turn on loading for all listening hooks use client.requestManager.events.emitLoading() method.
|
|
81
|
+
*/
|
|
82
|
+
setStatus: (status: CacheSetState<ExtractAdapterStatusType<ExtractAdapterType<T>>>) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Action to set custom success. We can do it locally(inside hook state).
|
|
85
|
+
* If you need to update cache data use client.cache.update() method.
|
|
86
|
+
*/
|
|
87
|
+
setSuccess: (success: CacheSetState<boolean>) => void;
|
|
88
|
+
/**
|
|
89
|
+
* Action to set custom additional data. We can do it locally(inside hook state).
|
|
90
|
+
* If you need to update cache data use client.cache.update() method.
|
|
91
|
+
*/
|
|
92
|
+
setExtra: (extra: CacheSetState<ExtractAdapterExtraType<ExtractAdapterType<T>> | null>) => void;
|
|
93
|
+
/**
|
|
94
|
+
* Action to set custom retries count. We can do it locally(inside hook state).
|
|
95
|
+
* If you need to update cache data use client.cache.update() method.
|
|
96
|
+
*/
|
|
97
|
+
setRetries: (retries: CacheSetState<number>) => void;
|
|
98
|
+
/**
|
|
99
|
+
* Action to set custom timestamp. We can do it locally(inside hook state).
|
|
100
|
+
* If you need to update cache data use client.cache.update() method.
|
|
101
|
+
*/
|
|
102
|
+
setResponseTimestamp: (timestamp: CacheSetState<Date>) => void;
|
|
103
|
+
/**
|
|
104
|
+
* Action to set custom timestamp. We can do it locally(inside hook state).
|
|
105
|
+
* If you need to update cache data use client.cache.update() method.
|
|
106
|
+
*/
|
|
107
|
+
setRequestTimestamp: (timestamp: CacheSetState<Date>) => void;
|
|
108
|
+
/**
|
|
109
|
+
* Reset all state fields to their initial values (data, error, status, extra → null, loading → false, etc.).
|
|
110
|
+
*/
|
|
111
|
+
clearState: () => void;
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=use-tracked-state.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-t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,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAC5F;;;OAGG;IACH,UAAU,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACtD;;;OAGG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,CAAC;IAChG;;;OAGG;IACH,UAAU,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACrD;;;OAGG;IACH,oBAAoB,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC/D;;;OAGG;IACH,mBAAmB,EAAE,CAAC,SAAS,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC9D;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CacheValueType, NullableType, RequestInstance, ExtractResponseType, ExtractErrorType, ExtractAdapterResolvedType, Dispatcher, ExtractAdapterType, ResponseDetailsType } from '@hyper-fetch/core';
|
|
2
|
+
import { UseTrackedStateType } from '..';
|
|
3
|
+
/**
|
|
4
|
+
* Determines whether state should be cleared when the cache key changes.
|
|
5
|
+
*
|
|
6
|
+
* - `"clean"` — always clear
|
|
7
|
+
* - `"preserve"` — never clear
|
|
8
|
+
* - `"auto"` — clear when the resource identity changed (URL params), preserve when only query params changed
|
|
9
|
+
*/
|
|
10
|
+
export declare const getShouldClearState: (mode: "auto" | "preserve" | "clean", oldCacheKey: string, newCacheKey: string) => boolean;
|
|
11
|
+
export declare const getDetailsState: (state?: UseTrackedStateType<RequestInstance>, details?: Partial<ResponseDetailsType>) => ResponseDetailsType;
|
|
12
|
+
export declare const isStaleCacheData: (staleTime: number, staleTimestamp: NullableType<Date | number>) => boolean;
|
|
13
|
+
export declare const getValidCacheData: <T extends RequestInstance>(request: T, initialResponse: NullableType<Partial<ExtractAdapterResolvedType<T>>>, cacheData: NullableType<CacheValueType<ExtractResponseType<T>, ExtractErrorType<T>, ExtractAdapterType<T>>>) => CacheValueType<ExtractResponseType<T>, ExtractErrorType<T>, ExtractAdapterType<T>> | null;
|
|
14
|
+
export declare const getTimestamp: (timestamp?: NullableType<number | Date>) => Date | null;
|
|
15
|
+
export declare const getIsInitiallyLoading: <T extends RequestInstance>({ queryKey, dispatcher, hasState, revalidate, disabled, }: {
|
|
16
|
+
queryKey: string;
|
|
17
|
+
dispatcher: Dispatcher<ExtractAdapterType<T>>;
|
|
18
|
+
hasState: boolean;
|
|
19
|
+
revalidate?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}) => boolean;
|
|
22
|
+
export declare const getInitialState: <T extends RequestInstance>({ initialResponse, dispatcher, request, disabled, revalidate, }: {
|
|
23
|
+
initialResponse: NullableType<Partial<ExtractAdapterResolvedType<T>>>;
|
|
24
|
+
dispatcher: Dispatcher<ExtractAdapterType<T>>;
|
|
25
|
+
request: T;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
revalidate?: boolean;
|
|
28
|
+
}) => UseTrackedStateType<T>;
|
|
29
|
+
//# sourceMappingURL=use-tracked-state.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tracked-state.utils.d.ts","sourceRoot":"","sources":["../../../src/helpers/use-tracked-state/use-tracked-state.utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,0BAA0B,EAC1B,UAAU,EACV,kBAAkB,EAElB,mBAAmB,EAGpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAanD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,G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B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtE,UAAU,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,KAAG,mBAAmB,CAAC,CAAC,CAgDxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-app-manager/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-app-manager.hooks.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-app-manager/use-app-manager.hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAErE,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,cAAc,EAAE,QAAQ,MAAM,KAAG,uBA6B7E,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type UseAppManagerReturnType = {
|
|
2
|
+
/**
|
|
3
|
+
* Is window focused
|
|
4
|
+
*/
|
|
5
|
+
isFocused: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Network online status
|
|
8
|
+
*/
|
|
9
|
+
isOnline: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Network state setter
|
|
12
|
+
*/
|
|
13
|
+
setOnline: (isOnline: boolean) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Focus state setter
|
|
16
|
+
*/
|
|
17
|
+
setFocused: (isFocused: boolean) => void;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=use-app-manager.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-app-manager.types.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-app-manager/use-app-manager.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;OAEG;IACH,UAAU,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C,CAAC"}
|