From bf647bca842b5b6a6f7d1962af0598f854045848 Mon Sep 17 00:00:00 2001 From: zuochenxue Date: Wed, 27 Nov 2019 00:51:09 +0800 Subject: [PATCH] simplify getNestedState --- src/store.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/store.js b/src/store.js index 5dd65a0b9..c4cb3f1a5 100644 --- a/src/store.js +++ b/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) {