Skip to content

Commit 789c349

Browse files
authored
Merge branch 'master' into fix/types-generate
2 parents 6440ba8 + a019c4f commit 789c349

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swr",
3-
"version": "1.0.0-beta.7",
3+
"version": "1.0.0-beta.8",
44
"description": "React Hooks library for remote data fetching",
55
"main": "./dist/index.js",
66
"module": "./dist/index.esm.js",

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ export type SWRHook = <Data = any, Error = any>(
7171
) => SWRResponse<Data, Error>
7272

7373
// Middlewares guarantee that a SWRHook receives a key, fetcher, and config as the argument
74-
type SWRHookWithdMiddleware = <Data = any, Error = any>(
74+
type SWRHookWithMiddleware = <Data = any, Error = any>(
7575
key: Key,
7676
fetcher: Fetcher<Data> | null,
7777
config: SWRConfiguration<Data, Error>
7878
) => SWRResponse<Data, Error>
7979

80-
export type Middleware = (useSWRNext: SWRHook) => SWRHookWithdMiddleware
80+
export type Middleware = (useSWRNext: SWRHook) => SWRHookWithMiddleware
8181

8282
export type ValueKey = string | any[] | null
8383

src/use-swr.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export function useSWRHandler<Data = any, Error = any>(
233233
] = getGlobalState(cache)
234234

235235
// `key` is the identifier of the SWR `data` state.
236-
// `keyErr` and `keyValidating` are indentifiers of `error` and `isValidating`
236+
// `keyErr` and `keyValidating` are identifiers of `error` and `isValidating`
237237
// which are derived from `key`.
238238
// `fnArgs` is a list of arguments for `fn`.
239239
const [key, fnArgs, keyErr, keyValidating] = serialize(_key)
@@ -256,7 +256,7 @@ export function useSWRHandler<Data = any, Error = any>(
256256

257257
// A revalidation must be triggered when mounted if:
258258
// - `revalidateOnMount` is explicitly set to `true`.
259-
// - Suspense mode and there's stale data for the inital render.
259+
// - Suspense mode and there's stale data for the initial render.
260260
// - Not suspense mode and there is no `initialData` and `revalidateWhenStale` is enabled.
261261
// - `revalidateWhenStale` is enabled but `data` is not defined.
262262
const shouldRevalidateOnMount = () => {
@@ -494,7 +494,7 @@ export function useSWRHandler<Data = any, Error = any>(
494494
useIsomorphicLayoutEffect(() => {
495495
if (!key) return UNDEFINED
496496

497-
// Not the inital render.
497+
// Not the initial render.
498498
const keyChanged = initialMountedRef.current
499499
const softRevalidate = () => revalidate({ dedupe: true })
500500

0 commit comments

Comments
 (0)