Skip to content

Commit 06aeb21

Browse files
nixpulvisyangmillstheory
authored andcommitted
Rename some of the increment actions to noop. (#216)
1 parent 45c3a78 commit 06aeb21

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ Wraps an action creator so that its return value is the payload of a Flux Standa
3131
Example:
3232

3333
```js
34-
let increment = createAction('INCREMENT', amount => amount);
34+
let noop = createAction('NOOP', amount => amount);
3535
// same as
36-
increment = createAction('INCREMENT');
36+
noop = createAction('NOOP');
3737

38-
expect(increment(42)).to.deep.equal({
39-
type: 'INCREMENT',
38+
expect(noop(42)).to.deep.equal({
39+
type: 'NOOP',
4040
payload: 42
4141
});
4242
```
@@ -48,11 +48,11 @@ redux-actions will automatically set ```action.error``` to true.
4848
Example:
4949

5050
```js
51-
const increment = createAction('INCREMENT');
51+
const noop = createAction('NOOP');
5252

5353
const error = new TypeError('not a number');
54-
expect(increment(error)).to.deep.equal({
55-
type: 'INCREMENT',
54+
expect(noop(error)).to.deep.equal({
55+
type: 'NOOP',
5656
payload: error,
5757
error: true
5858
});
@@ -63,17 +63,17 @@ expect(increment(error)).to.deep.equal({
6363
Example:
6464

6565
```js
66-
const increment = createAction('INCREMENT');
66+
const noop = createAction('INCREMENT');
6767

6868
// As parameter in handleAction:
69-
handleAction(increment, {
69+
handleAction(noop, {
7070
next(state, action) {...},
7171
throw(state, action) {...}
7272
});
7373

7474
// As object key in handleActions:
7575
const reducer = handleActions({
76-
[increment]: (state, action) => ({
76+
[noop]: (state, action) => ({
7777
counter: state.counter + action.payload
7878
})
7979
}, { counter: 0 });

0 commit comments

Comments
 (0)