Skip to content

Commit d3979fd

Browse files
zuochenxuektsn
authored andcommitted
refactor: simplify getNestedState (#1651)
1 parent ba2ff3a commit d3979fd

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/store.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,7 @@ function enableStrictMode (store) {
489489
}
490490

491491
function getNestedState (state, path) {
492-
return path.length
493-
? path.reduce((state, key) => state[key], state)
494-
: state
492+
return path.reduce((state, key) => state[key], state)
495493
}
496494

497495
function unifyObjectStyle (type, payload, options) {

0 commit comments

Comments
 (0)