Skip to content

Commit

Permalink
Merge pull request #4438 from gsfk/fix-docs-spelling
Browse files Browse the repository at this point in the history
fix: docs spelling
  • Loading branch information
EskiMojo14 authored Jun 3, 2024
2 parents 68fe131 + 77c8455 commit 3927c0c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/api/createSlice.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ reducers: (create) => {

### `extraReducers`

Conceptually, each slice reducer "owns" its slice of state. There's also a natural correspondance between the update logic defined inside `reducers`, and the action types that are generated based on those.
Conceptually, each slice reducer "owns" its slice of state. There's also a natural correspondence between the update logic defined inside `reducers`, and the action types that are generated based on those.

However, there are many times that a Redux slice may also need to update its own state in response to action types that were defined elsewhere in the application (such as clearing many different kinds of data when a "user logged out" action is dispatched). This can include action types defined by another `createSlice` call, actions generated by a `createAsyncThunk`, RTK Query endpoint matchers, or any other action. In addition, one of the key concepts of Redux is that many slice reducers can independently respond to the same action type.

Expand Down
2 changes: 1 addition & 1 deletion docs/rtk-query/api/created-api/hooks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ selectFromResult: () => ({})
- `trigger`: A function that triggers an update to the data based on the provided argument. The trigger function returns a promise with the properties shown above that may be used to handle the behavior of the promise
- `mutationState`: A query status object containing the current loading state and metadata about the request, or the values returned by the `selectFromResult` option where applicable.
Additionally, this object will contain
- a `reset` method to reset the hook back to it's original state and remove the current result from the cache
- a `reset` method to reset the hook back to its original state and remove the current result from the cache
- an `originalArgs` property that contains the argument passed to the last call of the `trigger` function.
#### Description
Expand Down
2 changes: 1 addition & 1 deletion docs/rtk-query/api/fetchBaseQuery.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export const api = createApi({
query: () => ({
url: `users`,
// Example: we know the users endpoint is _really fast_ because it's always cached.
// We can assume if its over > 1000ms, something is wrong and we should abort the request.
// We can assume if it's over > 1000ms, something is wrong and we should abort the request.
timeout: 1000,
}),
}),
Expand Down
2 changes: 1 addition & 1 deletion docs/rtk-query/usage/mutations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Below are some of the most frequently used properties on the "mutation result" o
- `isLoading` - When true, indicates that the mutation has been fired and is awaiting a response.
- `isSuccess` - When true, indicates that the last mutation fired has data from a successful request.
- `isError` - When true, indicates that the last mutation fired resulted in an error state.
- `reset` - A method to reset the hook back to it's original state and remove the current result from the cache
- `reset` - A method to reset the hook back to its original state and remove the current result from the cache

:::note

Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/query/core/buildThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ In the case of an unhandled error, no tags will be "provided" or "invalidated".`
arg.forceRefetch ?? (arg.subscribe && baseFetchOnMountOrArgChange)

if (refetchVal) {
// Return if its true or compare the dates because it must be a number
// Return if it's true or compare the dates because it must be a number
return (
refetchVal === true ||
(Number(new Date()) - Number(fulfilledVal)) / 1000 >= refetchVal
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/query/endpointDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ interface EndpointDefinitionWithQueryFn<
* if (randomVal < 0.9) {
* return { data: 'tails' }
* }
* return { error: { status: 500, statusText: 'Internal Server Error', data: "Coin landed on it's edge!" } }
* return { error: { status: 500, statusText: 'Internal Server Error', data: "Coin landed on its edge!" } }
* }
* // highlight-end
* })
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/query/react/buildHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ export type UseMutationStateResult<
> = TSHelpersNoInfer<R> & {
originalArgs?: QueryArgFrom<D>
/**
* Resets the hook state to it's initial `uninitialized` state.
* Resets the hook state to its initial `uninitialized` state.
* This will also remove the last result from the cache.
*/
reset: () => void
Expand Down

0 comments on commit 3927c0c

Please sign in to comment.