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 docs build #3419

Merged
merged 1 commit into from
May 5, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"@manaflair/redux-batch": "^1.0.0",
"@types/nanoid": "^2.1.0",
"@types/react": "^18.0",
"@types/redux-logger": "^3.0.8",
"async-mutex": "^0.3.2",
"axios": "^0.20.0",
"formik": "^2.1.5",
Expand Down
7 changes: 6 additions & 1 deletion docs/rtk-query/usage/customizing-create-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ If you want the hooks to use different versions of `useSelector`, `useDispatch`

```ts
import * as React from 'react'
import { createDispatchHook, ReactReduxContextValue } from 'react-redux'
import {
createDispatchHook,
createSelectorHook,
createStoreHook,
ReactReduxContextValue,
} from 'react-redux'
import {
buildCreateApi,
coreModule,
Expand Down
8 changes: 7 additions & 1 deletion docs/rtk-query/usage/error-handling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ export const rtkQueryErrorLogger: Middleware =
// RTK Query uses `createAsyncThunk` from redux-toolkit under the hood, so we're able to utilize these matchers!
if (isRejectedWithValue(action)) {
console.warn('We got a rejected action!')
toast.warn({ title: 'Async error!', message: action.error.data.message })
toast.warn({
title: 'Async error!',
message:
'data' in action.error
? (action.error.data as { message: string }).message
: action.error.message,
})
}

return next(action)
Expand Down
37 changes: 28 additions & 9 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,36 @@
"baseUrl": "..",
"jsx": "preserve",
"paths": {
"react": [ "../node_modules/@types/react" ],
"react-dom": [ "../node_modules/@types/react-dom" ],
"@reduxjs/toolkit": ["packages/toolkit/src/index.ts"],
"@reduxjs/toolkit/query": ["packages/toolkit/src/query/index.ts"],
"react": [
"../node_modules/@types/react"
],
"react-dom": [
"../node_modules/@types/react-dom"
],
"@reduxjs/toolkit": [
"packages/toolkit/src/index.ts"
],
"@reduxjs/toolkit/query": [
"packages/toolkit/src/query/index.ts"
],
"@reduxjs/toolkit/query/react": [
"packages/toolkit/src/query/react/index.ts"
],
"@reduxjs/toolkit/dist/query/*": ["packages/toolkit/src/query/*"],
"@virtual/*": ["docs/virtual/*"],
"your-cool-library": ["docs/virtual/your-cool-library/index.ts"],
"petstore-api.generated": ["docs/virtual/petstore-api.generated/index.ts"]
"@reduxjs/toolkit/dist/query/*": [
"packages/toolkit/src/query/*"
],
"@virtual/*": [
"docs/virtual/*"
],
"your-cool-library": [
"docs/virtual/your-cool-library/index.ts"
],
"redux-logger": [
"docs/virtual/redux-logger/index.ts"
],
"petstore-api.generated": [
"docs/virtual/petstore-api.generated/index.ts"
]
}
}
}
}
7 changes: 7 additions & 0 deletions docs/virtual/redux-logger/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { Middleware } from 'redux'

declare const logger: Middleware

export { logger }

export default logger
12 changes: 1 addition & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8234,15 +8234,6 @@ __metadata:
languageName: node
linkType: hard

"@types/redux-logger@npm:^3.0.8":
version: 3.0.8
resolution: "@types/redux-logger@npm:3.0.8"
dependencies:
redux: ^4.0.0
checksum: 68dee8799db09aab2625435008230543f23a6dcf4f29cb8f74d2ec3c723c98765d6ed8fbf1edf2deb440f4a1969082b7d35d9548ab810e9054aa381bc925874c
languageName: node
linkType: hard

"@types/resolve@npm:1.17.1":
version: 1.17.1
resolution: "@types/resolve@npm:1.17.1"
Expand Down Expand Up @@ -13456,7 +13447,6 @@ __metadata:
"@manaflair/redux-batch": ^1.0.0
"@types/nanoid": ^2.1.0
"@types/react": ^18.0
"@types/redux-logger": ^3.0.8
async-mutex: ^0.3.2
axios: ^0.20.0
formik: ^2.1.5
Expand Down Expand Up @@ -24686,7 +24676,7 @@ fsevents@^1.2.7:
languageName: node
linkType: hard

"redux@npm:^4.0.0, redux@npm:^4.1.2":
"redux@npm:^4.1.2":
version: 4.1.2
resolution: "redux@npm:4.1.2"
dependencies:
Expand Down