Skip to content

Commit 9a274b0

Browse files
committed
Merge branch 'master' into create-slice-creators
2 parents 8360f12 + fd24f6f commit 9a274b0

File tree

34 files changed

+1139
-2184
lines changed

34 files changed

+1139
-2184
lines changed

.github/workflows/test-codegen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
strategy:
3333
matrix:
34-
node-version: ['16.x']
34+
node-version: ['18.x']
3535

3636
steps:
3737
- uses: actions/checkout@v2

docs/api/createEntityAdapter.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ export interface EntityStateAdapter<T> {
139139
addMany<S extends EntityState<T>>(state: S, entities: T[]): S
140140
addMany<S extends EntityState<T>>(state: S, entities: PayloadAction<T[]>): S
141141

142+
setOne<S extends EntityState<T>>(state: S, entity: T): S
143+
setOne<S extends EntityState<T>>(state: S, action: PayloadAction<T>): S
144+
145+
setMany<S extends EntityState<T>>(state: S, entities: T[]): S
146+
setMany<S extends EntityState<T>>(state: S, entities: PayloadAction<T[]>): S
147+
142148
setAll<S extends EntityState<T>>(state: S, entities: T[]): S
143149
setAll<S extends EntityState<T>>(state: S, entities: PayloadAction<T[]>): S
144150

docs/api/createSlice.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Similar to `createReducer`, the `extraReducers` field uses a "builder callback"
215215

216216
[examples](docblock://createSlice.ts?token=CreateSliceOptions.extraReducers)
217217

218-
See [the "Builder Callback Notation" section of the `createReducer` reference](./createReducer.mdx#usage-with-the-builder-callback-notation) for details on how to use `builder.addCase`, `builder.addMatcher`, and `builder.addDefault`
218+
See [the "Builder Callback Notation" section of the `createReducer` reference](./createReducer.mdx#usage-with-the-builder-callback-notation) for details on how to use `builder.addCase`, `builder.addMatcher`, and `builder.addDefaultCase`
219219

220220
### `reducerPath`
221221

docs/rtk-query/usage/queries.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ This example demonstrates request deduplication and caching behavior:
358358
2. A second later, another `Pokemon` component is rendered with 'bulbasaur'
359359
- Notice that this one doesn't ever show 'Loading...' and no new network request happens? It's using the cache here.
360360
3. A moment after that, a `Pokemon` component for 'pikachu' is added, and a new request happens.
361-
4. When you click 'Refetch' of a particular pokemon type, it'll update all of them with one request.
361+
4. When you click 'Refetch' for a specific `Pokemon`, it'll update all instances of that `Pokemon` with one request.
362362

363363
:::note Try it out
364364
Click the 'Add bulbasaur' button. You'll observe the same behavior described above until you click the 'Refetch' button on one of the components.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"prettier": "^3.2.4",
3939
"release-it": "^14.12.5",
4040
"serve": "^14.2.0",
41+
"ts-node": "^10.9.2",
4142
"typescript": "^5.2.2"
4243
},
4344
"resolutions": {
@@ -53,7 +54,6 @@
5354
"react": "npm:18.2.0",
5455
"react-dom": "npm:18.2.0",
5556
"resolve": "1.22.1",
56-
"ts-node": "10.4.0",
5757
"@types/react": "npm:18.0.12",
5858
"@types/react-dom": "npm:18.0.5",
5959
"@types/inquirer": "npm:8.2.1",

packages/rtk-codemods/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rtk-codemods <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
1818
## Local Usage
1919

2020
```
21-
node ./bin/cli.js <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
21+
node ./bin/cli.mjs <TRANSFORM NAME> path/of/files/ or/some**/*glob.js
2222
```
2323

2424
## Transforms
File renamed without changes.

packages/rtk-codemods/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "@reduxjs/rtk-codemods",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"scripts": {
55
"lint": "eslint .",
66
"test": "vitest --run",
77
"test:watch": "vitest --watch",
88
"test:coverage": "vitest --coverage"
99
},
10-
"bin": "./bin/cli.js",
10+
"bin": "./bin/cli.mjs",
1111
"files": [
1212
"bin/*",
1313
"transforms/**/index.ts",

packages/rtk-codemods/transforms/createReducerBuilder/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rtk-codemods createReducerBuilder path/of/files/ or/some**/*glob.js
1818
## Local Usage
1919

2020
```
21-
node ./bin/cli.js createReducerBuilder path/of/files/ or/some**/*glob.js
21+
node ./bin/cli.mjs createReducerBuilder path/of/files/ or/some**/*glob.js
2222
```
2323

2424
## Input / Output

packages/rtk-codemods/transforms/createSliceBuilder/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rtk-codemods createSliceBuilder path/of/files/ or/some**/*glob.js
1818
## Local Usage
1919

2020
```
21-
node ./bin/cli.js createSliceBuilder path/of/files/ or/some**/*glob.js
21+
node ./bin/cli.mjs createSliceBuilder path/of/files/ or/some**/*glob.js
2222
```
2323

2424
## Input / Output

0 commit comments

Comments
 (0)