Skip to content

Commit

Permalink
refactor: simplify getNestedState (#1651)
Browse files Browse the repository at this point in the history
  • Loading branch information
zuochenxue authored and ktsn committed Nov 27, 2019
1 parent ba2ff3a commit d3979fd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,7 @@ function enableStrictMode (store) {
}

function getNestedState (state, path) {
return path.length
? path.reduce((state, key) => state[key], state)
: state
return path.reduce((state, key) => state[key], state)
}

function unifyObjectStyle (type, payload, options) {
Expand Down

0 comments on commit d3979fd

Please sign in to comment.