Skip to content

Commit

Permalink
fix: wrong spell (#1902)
Browse files Browse the repository at this point in the history
  • Loading branch information
baojie223 committed Apr 4, 2022
1 parent 8658c95 commit b64c316
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/use-swr.ts
Expand Up @@ -214,7 +214,7 @@ export const useSWRHandler = <Data = any, Error = any>(
}

// 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<Key>),
getTimestamp()
Expand Down Expand Up @@ -290,7 +290,7 @@ export const useSWRHandler = <Data = any, Error = any>(
// 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
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/hash.ts
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/utils/mutate.ts
Expand Up @@ -17,7 +17,7 @@ export const internalMutate = async <Data>(
) => {
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 || {}
Expand All @@ -30,7 +30,7 @@ export const internalMutate = async <Data>(
const revalidate = options.revalidate !== false
const rollbackOnError = options.rollbackOnError !== false

// Serilaize key
// Serialize key
const [key] = serialize(_key)
if (!key) return

Expand Down
2 changes: 1 addition & 1 deletion src/utils/serialize.ts
Expand Up @@ -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

Expand Down

0 comments on commit b64c316

Please sign in to comment.