Skip to content

Commit 9c0b741

Browse files
pvoronatimdorr
andcommitted
Iterate using for in instead of Object.keys and minor fixes (#3371)
* Iterate using for in * Use single quotes for string literals without interpolation * Fix punctuation. * Limit node version until we update jest. Co-authored-by: Tim Dorr <[email protected]>
1 parent 6949ba0 commit 9c0b741

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- "node"
3+
- "11.10.1"
44
install:
55
- npm i -g [email protected]
66
- npm ci

src/applyMiddleware.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export default function applyMiddleware(...middlewares) {
2121
const store = createStore(...args)
2222
let dispatch = () => {
2323
throw new Error(
24-
`Dispatching while constructing your middleware is not allowed. ` +
25-
`Other middleware would not be applied to this dispatch.`
24+
'Dispatching while constructing your middleware is not allowed. ' +
25+
'Other middleware would not be applied to this dispatch.'
2626
)
2727
}
2828

src/bindActionCreators.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ export default function bindActionCreators(actionCreators, dispatch) {
3939
)
4040
}
4141

42-
const keys = Object.keys(actionCreators)
4342
const boundActionCreators = {}
44-
for (let i = 0; i < keys.length; i++) {
45-
const key = keys[i]
43+
for (const key in actionCreators) {
4644
const actionCreator = actionCreators[key]
4745
if (typeof actionCreator === 'function') {
4846
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch)

src/createStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default function createStore(reducer, preloadedState, enhancer) {
3636
throw new Error(
3737
'It looks like you are passing several store enhancers to ' +
3838
'createStore(). This is not supported. Instead, compose them ' +
39-
'together to a single function'
39+
'together to a single function.'
4040
)
4141
}
4242

0 commit comments

Comments
 (0)