Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
Set initial location state.
Browse files Browse the repository at this point in the history
This handles Dev Tools resets better, as the INIT action will not have an empty location for initialState.

Fixes #207
  • Loading branch information
timdorr committed Feb 1, 2016
1 parent 1935164 commit a00acfd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit a00acfd

Please sign in to comment.