From b64c3168a0de05c14b6e50518993a45b1f2d6b1b Mon Sep 17 00:00:00 2001 From: Jerry Bao Date: Tue, 5 Apr 2022 01:36:05 +0800 Subject: [PATCH] fix: wrong spell (#1902) --- src/use-swr.ts | 4 ++-- src/utils/hash.ts | 2 +- src/utils/mutate.ts | 4 ++-- src/utils/serialize.ts | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/use-swr.ts b/src/use-swr.ts index 045f97987..358b6cdb4 100644 --- a/src/use-swr.ts +++ b/src/use-swr.ts @@ -214,7 +214,7 @@ export const useSWRHandler = ( } // Start the request and save the timestamp. - // Key must be truthly if entering here. + // Key must be truthy if entering here. FETCH[key] = [ currentFetcher(fnArg as DefinitelyTruthy), getTimestamp() @@ -290,7 +290,7 @@ export const useSWRHandler = ( // data and newData are deeply equal // it should be safe to broadcast the stale data newState.data = stateRef.current.data - // At the end of this function, `brocastState` invokes the `onStateUpdate` function, + // At the end of this function, `broadcastState` invokes the `onStateUpdate` function, // which takes care of avoiding the re-render } diff --git a/src/utils/hash.ts b/src/utils/hash.ts index 0c6ecaaa7..4f71d6074 100644 --- a/src/utils/hash.ts +++ b/src/utils/hash.ts @@ -16,7 +16,7 @@ let counter = 0 // - Generates short results // // This is not a serialization function, and the result is not guaranteed to be -// parsible. +// parsable. export const stableHash = (arg: any): string => { const type = typeof arg const constructor = arg && arg.constructor diff --git a/src/utils/mutate.ts b/src/utils/mutate.ts index 9b224ea2c..91b99a402 100644 --- a/src/utils/mutate.ts +++ b/src/utils/mutate.ts @@ -17,7 +17,7 @@ export const internalMutate = async ( ) => { const [cache, _key, _data, _opts] = args - // When passing as a boolean, it's explicitily used to disable/enable + // When passing as a boolean, it's explicitly used to disable/enable // revalidation. const options = typeof _opts === 'boolean' ? { revalidate: _opts } : _opts || {} @@ -30,7 +30,7 @@ export const internalMutate = async ( const revalidate = options.revalidate !== false const rollbackOnError = options.rollbackOnError !== false - // Serilaize key + // Serialize key const [key] = serialize(_key) if (!key) return diff --git a/src/utils/serialize.ts b/src/utils/serialize.ts index 6eda57876..f13b7de86 100644 --- a/src/utils/serialize.ts +++ b/src/utils/serialize.ts @@ -13,7 +13,7 @@ export const serialize = (key: Key): [string, Key] => { } } - // Use the original key as the argument of fether. This can be a stirng or an + // Use the original key as the argument of fetcher. This can be a string or an // array of values. const args = key