From a00acfd4310ba5eaf3a9530b0f3fa8bd3d312c6e Mon Sep 17 00:00:00 2001 From: Tim Dorr Date: Mon, 1 Feb 2016 00:21:10 -0500 Subject: [PATCH] Set initial location state. This handles Dev Tools resets better, as the INIT action will not have an empty location for initialState. Fixes #207 --- src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index fac1bf0..6e342f0 100644 --- a/src/index.js +++ b/src/index.js @@ -47,6 +47,8 @@ export function syncHistory(history) { let unsubscribeHistory, currentKey, unsubscribeStore let connected = false, syncing = false + history.listen(location => { initialState.location = location })() + function middleware(store) { setTimeout(() => { unsubscribeHistory = history.listen(location => {