Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong spell #1902

Merged
merged 1 commit into from Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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