Skip to content

Commit 35d698e

Browse files
committed
docs(model): fix error action params
1 parent 103b146 commit 35d698e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,14 @@ TypeScript Example
384384

385385
const model: NextModelType<StateType, ActionsParamType> = {
386386
actions: {
387-
increment: async (s, _, params) => {
387+
increment: async (params, { state: s }) => {
388388
// issue: https://github.com/Microsoft/TypeScript/issues/29196
389389
// async function return produce need define type manually.
390390
return (state: typeof s) => {
391391
state.counter += params || 1
392392
}
393393
},
394-
decrease: (s, _, params) => s => {
394+
decrease: params => s => {
395395
s.counter += params || 1
396396
}
397397
}
@@ -405,7 +405,7 @@ JavaScript Example
405405
```js
406406
const Model = {
407407
actions: {
408-
increment: async (s, _, params) => {
408+
increment: async params => {
409409
return state => {
410410
state.counter += params || 1
411411
}

0 commit comments

Comments
 (0)