Skip to content

Commit 499d1b8

Browse files
committed
middlewares -> middleware
1 parent efb7d98 commit 499d1b8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export interface SWRHook {
119119
): SWRResponse<Data, Error>
120120
}
121121

122-
// Middlewares guarantee that a SWRHook receives a key, fetcher, and config as the argument
122+
// Middleware guarantee that a SWRHook receives a key, fetcher, and config as the argument
123123
export type Middleware = (
124124
useSWRNext: SWRHook
125125
) => <Data = any, Error = any>(

src/utils/with-middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const withMiddleware = (
1515
| [Key, Fetcher<Data> | null, SWRConfiguration | undefined]
1616
) => {
1717
const [key, fn, config] = normalize(args)
18-
const middlewares = (config.use || []).concat(middleware)
19-
return useSWR<Data, Error>(key, fn, { ...config, use: middlewares })
18+
const uses = (config.use || []).concat(middleware)
19+
return useSWR<Data, Error>(key, fn, { ...config, use: uses })
2020
}
2121
}

0 commit comments

Comments
 (0)