Skip to content

Commit

Permalink
Iterate using for in instead of Object.keys and minor fixes (reduxjs#…
Browse files Browse the repository at this point in the history
…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 <timdorr@users.noreply.github.com>
  • Loading branch information
2 people authored and kiku-jw committed Apr 6, 2019
1 parent 7eeb735 commit 9523f2e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "node"
- "11.10.1"
install:
- npm i -g npm@5.8.0
- npm ci
Expand Down
4 changes: 2 additions & 2 deletions src/applyMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default function applyMiddleware(...middlewares) {
const store = createStore(...args)
let dispatch = () => {
throw new Error(
`Dispatching while constructing your middleware is not allowed. ` +
`Other middleware would not be applied to this dispatch.`
'Dispatching while constructing your middleware is not allowed. ' +
'Other middleware would not be applied to this dispatch.'
)
}

Expand Down
4 changes: 1 addition & 3 deletions src/bindActionCreators.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ export default function bindActionCreators(actionCreators, dispatch) {
)
}

const keys = Object.keys(actionCreators)
const boundActionCreators = {}
for (let i = 0; i < keys.length; i++) {
const key = keys[i]
for (const key in actionCreators) {
const actionCreator = actionCreators[key]
if (typeof actionCreator === 'function') {
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch)
Expand Down
2 changes: 1 addition & 1 deletion src/createStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function createStore(reducer, preloadedState, enhancer) {
throw new Error(
'It looks like you are passing several store enhancers to ' +
'createStore(). This is not supported. Instead, compose them ' +
'together to a single function'
'together to a single function.'
)
}

Expand Down

0 comments on commit 9523f2e

Please sign in to comment.