Skip to content

Commit

Permalink
rename type for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed Aug 11, 2023
1 parent e5dbd73 commit 2030d24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions packages/router/__tests__/router-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import type {
AgnosticNonIndexRouteObject,
AgnosticRouteObject,
DeferredData,
ShouldRevalidateArgs,
ShouldRevalidateFunctionArgs,
TrackedPromise,
} from "../utils";
import {
Expand Down Expand Up @@ -1861,7 +1861,7 @@ describe("a router", () => {
router.navigate("/params/aValue/bValue");
await tick();
expect(rootLoader.mock.calls.length).toBe(1);
let expectedArg: ShouldRevalidateArgs = {
let expectedArg: ShouldRevalidateFunctionArgs = {
currentParams: {},
currentUrl: expect.URL("http://localhost/child"),
nextParams: {
Expand Down Expand Up @@ -1926,7 +1926,7 @@ describe("a router", () => {
expect(shouldRevalidate.mock.calls.length).toBe(1);
// @ts-expect-error
let arg = shouldRevalidate.mock.calls[0][0];
let expectedArg: ShouldRevalidateArgs = {
let expectedArg: ShouldRevalidateFunctionArgs = {
currentParams: {},
currentUrl: expect.URL("http://localhost/child"),
nextParams: {},
Expand Down Expand Up @@ -1980,7 +1980,7 @@ describe("a router", () => {
expect(shouldRevalidate.mock.calls.length).toBe(1);
// @ts-expect-error
let arg = shouldRevalidate.mock.calls[0][0];
let expectedArg: ShouldRevalidateArgs = {
let expectedArg: ShouldRevalidateFunctionArgs = {
currentParams: {},
currentUrl: expect.URL("http://localhost/child"),
nextParams: {},
Expand Down Expand Up @@ -2026,7 +2026,7 @@ describe("a router", () => {
expect(shouldRevalidate.mock.calls.length).toBe(1);
// @ts-expect-error
let arg = shouldRevalidate.mock.calls[0][0];
let expectedArg: Partial<ShouldRevalidateArgs> = {
let expectedArg: Partial<ShouldRevalidateFunctionArgs> = {
formMethod: "post",
formAction: "/",
formEncType: "application/json",
Expand Down Expand Up @@ -2068,7 +2068,7 @@ describe("a router", () => {
expect(shouldRevalidate.mock.calls.length).toBe(1);
// @ts-expect-error
let arg = shouldRevalidate.mock.calls[0][0];
let expectedArg: Partial<ShouldRevalidateArgs> = {
let expectedArg: Partial<ShouldRevalidateFunctionArgs> = {
formMethod: "post",
formAction: "/",
formEncType: "text/plain",
Expand Down
4 changes: 2 additions & 2 deletions packages/router/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export interface ActionFunction {
/**
* Arguments passed to shouldRevalidate function
*/
export interface ShouldRevalidateArgs {
export interface ShouldRevalidateFunctionArgs {
currentUrl: URL;
currentParams: AgnosticDataRouteMatch["params"];
nextUrl: URL;
Expand All @@ -200,7 +200,7 @@ export interface ShouldRevalidateArgs {
* have to re-run based on the data models that were potentially mutated.
*/
export interface ShouldRevalidateFunction {
(args: ShouldRevalidateArgs): boolean;
(args: ShouldRevalidateFunctionArgs): boolean;
}

/**
Expand Down

0 comments on commit 2030d24

Please sign in to comment.