Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit c7c5352

Browse files
committed
Updating documentation for thunk.
1 parent 502f8e0 commit c7c5352

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

docs/api/actions.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
- [Model Action Creators](#model-action-creators)
44
- [`actions.change()`](#actions-change)
55
- [`actions.reset()`](#actions-reset)
6-
- [`actions.merge()`](#actions-merge)
7-
- [`actions.xor()`](#actions-xor)
8-
- [`actions.toggle()`](#actions-toggle)
9-
- [`actions.filter()`](#actions-filter)
10-
- [`actions.map()`](#actions-map)
11-
- [`actions.remove()`](#actions-remove)
12-
- [`actions.move()`](#actions-move)
13-
- [`actions.load()`](#actions-load)
14-
- [`actions.omit()`](#actions-omit)
6+
- **Action thunk creators:**
7+
- [`actions.merge()`](#actions-merge)
8+
- [`actions.xor()`](#actions-xor)
9+
- [`actions.toggle()`](#actions-toggle)
10+
- [`actions.filter()`](#actions-filter)
11+
- [`actions.map()`](#actions-map)
12+
- [`actions.remove()`](#actions-remove)
13+
- [`actions.move()`](#actions-move)
14+
- [`actions.load()`](#actions-load)
15+
- [`actions.omit()`](#actions-omit)
1516
- [Field Action Creators](#field-action-creators)
1617
- [`actions.focus()`](#actions-focus)
1718
- [`actions.blur()`](#actions-blur)
@@ -20,22 +21,25 @@
2021
- [`actions.setPending()`](#actions-setPending)
2122
- [`actions.setTouched()`](#actions-setTouched)
2223
- [`actions.setUntouched()`](#actions-setUntouched)
23-
- [`actions.submit()`](#actions-submit)
24-
- [`actions.submitFields()`](#actions-submitFields)
2524
- [`actions.setSubmitted()`](#actions-setSubmitted)
2625
- [`actions.setSubmitFailed()`](#actions-setSubmitFailed)
2726
- [`actions.setInitial()`](#actions-setInitial)
27+
- **Action thunk creators:**
28+
- [`actions.submit()`](#actions-submit)
29+
- [`actions.submitFields()`](#actions-submitFields)
2830
- [Validation Action Creators](#validation-action-creators)
2931
- [`actions.setValidity()`](#actions-setValidity)
3032
- [`actions.setFieldsValidity()`](#actions-setFieldsValidity)
31-
- [`actions.validate()`](#actions-validate)
32-
- [`actions.validateFields()`](#actions-validate)
33-
- [`actions.asyncSetValidity()`](#actions-asyncSetValidity)
3433
- [`actions.setErrors()`](#actions-setErrors)
3534
- [`actions.setFieldsErrors()`](#actions-setFieldsErrors)
36-
- [`actions.validateErrors()`](#actions-validateErrors)
37-
- [`actions.validateFieldsErrors()`](#actions-validateFieldsErrors)
3835
- [`actions.resetValidity()`](#actions-resetValidity)
36+
- **Action thunk creators:**
37+
- [`actions.validate()`](#actions-validate)
38+
- [`actions.validateFields()`](#actions-validate)
39+
- [`actions.asyncSetValidity()`](#actions-asyncSetValidity)
40+
- [`actions.validateErrors()`](#actions-validateErrors)
41+
- [`actions.validateFieldsErrors()`](#actions-validateFieldsErrors)
42+
3943

4044
# Model Action Creators
4145

@@ -60,6 +64,8 @@ Returns an action that, when handled by a `modelReducer`, changes the value of t
6064

6165
When the change action is handled by a [`formReducer`](./formReducer), the field model's `.dirty` state is set to `true` and its corresponding `.pristine` state is set to `false`.
6266

67+
**Note:** if using `track`, `redux-thunk` is required.
68+
6369
### Arguments
6470
- `model` _(String | Function)_: the model whose value will be changed
6571
- `value` _(any)_: the value the model will be changed to
@@ -257,13 +263,13 @@ Dispatches an `actions.change(...)` action with the `model` value updated to not
257263
// {
258264
// test: {
259265
// foo: 1,
260-
// bar: 2,
266+
// bar: 2,
261267
// baz: 3
262268
// }
263269
// }
264270

265271
dispatch(actions.omit('test', 'foo'));
266-
// the new test state:
272+
// the new test state:
267273
// => { test: { bar: 2, baz: 3 } }
268274

269275
dispatch(actions.omit('test', ['foo', 'baz']);
@@ -292,7 +298,7 @@ import { actions } from 'react-redux-form';
292298
// in a connect()-ed component:
293299
const Newsletter = (props) => {
294300
const { newsletterForm, dispatch } = props;
295-
301+
296302
return <form>
297303
<input type="email"
298304
onFocus={() => dispatch(actions.focus('newsletter.email'))} />
@@ -479,7 +485,7 @@ import { actions } from 'react-redux-form';
479485
export default function submitUser(data) {
480486
return (dispatch) => {
481487
dispatch(actions.setPending('user', true));
482-
488+
483489
fetch('...', { body: data })
484490
.then((response) => {
485491
// handle the response, then...

0 commit comments

Comments
 (0)