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

Make coding style more consistent #143

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ let initialState = {
replace: false
}

function update(state=initialState, { type, payload }) {
if(type === UPDATE_PATH) {
function update(state = initialState, { type, payload }) {
if (type === UPDATE_PATH) {
return Object.assign({}, state, {
path: payload.path,
changeId: state.changeId + (payload.avoidRouterUpdate ? 0 : 1),
Expand Down Expand Up @@ -78,7 +78,7 @@ export function syncReduxAndRouter(history, store, selectRouterState = SELECT_ST
// reloads the entire app state such as redux devtools.
let lastRoute = undefined

if(!getRouterState()) {
if (!getRouterState()) {
throw new Error(
'Cannot sync router: route state does not exist (`state.routing` by default). ' +
'Did you install the routing reducer?'
Expand Down Expand Up @@ -114,7 +114,7 @@ export function syncReduxAndRouter(history, store, selectRouterState = SELECT_ST
lastRoute = initialState

store.dispatch(pushPath(route.path, route.state, { avoidRouterUpdate: true }));
} else if(!locationsAreEqual(getRouterState(), route)) {
} else if (!locationsAreEqual(getRouterState(), route)) {
// The above check avoids dispatching an action if the store is
// already up-to-date
const method = location.action === 'REPLACE' ? replacePath : pushPath
Expand All @@ -127,7 +127,7 @@ export function syncReduxAndRouter(history, store, selectRouterState = SELECT_ST

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

lastRoute = routing
Expand Down