소스 검색

refactor: simplify getNestedState (#1651)

ZuoChenxue 5 년 전
부모
커밋
d3979fddd5
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 3
      src/store.js

+ 1 - 3
src/store.js

@@ -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) {