Skip to content

Commit a15d2f2

Browse files
committed
no longer necessary to merge with state
1 parent 4cebf6d commit a15d2f2

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/factory.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ const makeSpy = (keys, accessor) => {
3333
}
3434

3535
const defaultEffects = {
36-
linkState: (_, { target }) => state => ({
37-
...state,
36+
linkState: (_, { target }) => () => ({
3837
[target.name]: target.nodeName.toLowerCase() === 'input' &&
3938
target.type.toLowerCase() === 'checkbox'
4039
? target.checked
4140
: target.value,
4241
}),
43-
toggleState: (_, { target: { name } }) => state => ({ ...state, [name]: !state[name] }),
42+
toggleState: (_, { target: { name } }) => state => ({ [name]: !state[name] }),
4443
}
4544

4645
module.exports = ({ Component, createElement, PropTypes }) => {

0 commit comments

Comments
 (0)