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

Commit

Permalink
Clean up location check
Browse files Browse the repository at this point in the history
  • Loading branch information
kimjoar committed Dec 5, 2015
1 parent 4091b1e commit ab7b481
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ function syncReduxAndRouter(history, store, selectRouterState = SELECT_STATE) {
routing = firstRoute;
}

if(lastRoute !== undefined && lastRoute.changeId === routing.changeId) {
if(locationsAreEqual(routing, lastRoute)) return;
// Only trigger history update is this is a new change or the location
// has changed.
if(lastRoute !== undefined &&
lastRoute.changeId === routing.changeId &&
locationsAreEqual(lastRoute, routing)) {
return;
}

lastRoute = routing;
Expand Down

0 comments on commit ab7b481

Please sign in to comment.