Skip to content

Commit c086463

Browse files
committed
feat: 🎸 Added possibility to revalidate cache by array of keys
We can now pass the array of the invalidation keys to the revalidate method.
1 parent d10ffcd commit c086463

34 files changed

+56
-33
lines changed

‎packages/react/__tests__/features/use-fetch/use-fetch.integration.spec.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useState } from "react";
22
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
33

4-
import { useFetch } from "use-fetch";
4+
import { useFetch } from "hooks/use-fetch";
55
import { createCommand, builder, waitForRender } from "../../utils";
66
import { startServer, resetInterceptors, stopServer, createRequestInterceptor } from "../../server";
77

‎packages/react/__tests__/features/use-fetch/use-fetch.prefetch.spec.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render, screen, waitFor } from "@testing-library/react";
22

3-
import { useFetch } from "use-fetch";
3+
import { useFetch } from "hooks/use-fetch";
44
import { startServer, resetInterceptors, stopServer, createRequestInterceptor } from "../../server";
55
import { builder, createCommand } from "../../utils";
66

‎packages/react/__tests__/features/use-fetch/use-fetch.rerender.spec.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useDidMount, useDidUpdate } from "@better-typed/react-lifecycle-hooks";
22
import { render } from "@testing-library/react";
33

4-
import { useFetch } from "use-fetch";
4+
import { useFetch } from "hooks/use-fetch";
55
import { startServer, resetInterceptors, stopServer, createRequestInterceptor } from "../../server";
66
import { builder, createCommand, sleep, waitForRender } from "../../utils";
77

‎packages/react/__tests__/features/use-fetch/use-fetch.utils.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getRefreshTime } from "use-fetch";
1+
import { getRefreshTime } from "hooks/use-fetch";
22

33
describe("useFetch [ Utils ]", () => {
44
const refreshTime = 1000;

‎packages/react/__tests__/shared/response.tests.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { waitFor, RenderHookResult } from "@testing-library/react";
22
import { ClientResponseType, CommandInstance } from "@better-typed/hyper-fetch";
33

4-
import { UseFetchReturnType } from "use-fetch";
5-
import { UseSubmitReturnType } from "use-submit";
4+
import { UseFetchReturnType } from "hooks/use-fetch";
5+
import { UseSubmitReturnType } from "hooks/use-submit";
66
import { getCurrentState } from "../utils";
77

88
export const testInitialState = <H extends RenderHookResult<any, any>>(render: H, expectedLoading = true) => {

‎packages/react/__tests__/utils/use-app-manager.utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BuilderInstance } from "@better-typed/hyper-fetch";
22
import { renderHook } from "@testing-library/react";
33

4-
import { useAppManager } from "use-app-manager";
4+
import { useAppManager } from "hooks/use-app-manager";
55

66
export const renderUseAppManager = <B extends BuilderInstance>(builder: B) => {
77
return renderHook(() => {

‎packages/react/__tests__/utils/use-cache.utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CommandInstance } from "@better-typed/hyper-fetch";
22
import { renderHook } from "@testing-library/react";
33

4-
import { useCache, UseCacheOptionsType } from "use-cache";
4+
import { useCache, UseCacheOptionsType } from "hooks/use-cache";
55

66
export const renderUseCache = <T extends CommandInstance>(command: T, options?: UseCacheOptionsType<T>) => {
77
return renderHook((rerenderOptions: UseCacheOptionsType<CommandInstance> & { command?: CommandInstance }) => {

‎packages/react/__tests__/utils/use-fetch.utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CommandInstance } from "@better-typed/hyper-fetch";
22
import { renderHook } from "@testing-library/react";
33

4-
import { useFetch, UseFetchOptionsType } from "use-fetch";
4+
import { useFetch, UseFetchOptionsType } from "hooks/use-fetch";
55

66
export const renderUseFetch = <T extends CommandInstance>(command: T, options?: UseFetchOptionsType<T>) => {
77
return renderHook((rerenderOptions: UseFetchOptionsType<CommandInstance> & { command?: CommandInstance }) => {

‎packages/react/__tests__/utils/use-queue.utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { renderHook } from "@testing-library/react";
22
import { CommandInstance, getCommandDispatcher, getProgressData } from "@better-typed/hyper-fetch";
33

4-
import { useQueue, UseQueueOptionsType } from "use-queue";
4+
import { useQueue, UseQueueOptionsType } from "hooks/use-queue";
55

66
export const renderUseQueue = <T extends CommandInstance>(command: T, options?: UseQueueOptionsType) => {
77
return renderHook((rerenderOptions: UseQueueOptionsType & { command?: CommandInstance }) => {

‎packages/react/__tests__/utils/use-submit.utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CommandInstance } from "@better-typed/hyper-fetch";
22
import { renderHook } from "@testing-library/react";
33

4-
import { useSubmit, UseSubmitOptionsType } from "use-submit";
4+
import { useSubmit, UseSubmitOptionsType } from "hooks/use-submit";
55

66
export const renderUseSubmit = <T extends CommandInstance>(command: T, options?: UseSubmitOptionsType<T>) => {
77
return renderHook((rerenderOptions: UseSubmitOptionsType<CommandInstance> & { command?: CommandInstance }) => {

0 commit comments

Comments
 (0)