redux-json-router
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -11,13 +11,11 @@ 'use strict'; | ||
/** | ||
* Dispatch an action to initialize the router state in the store, then create | ||
* a history listener that updates the state upon an external (popstate) event | ||
* Dispatches a manualChange action once on app start, | ||
* and whenever a popstate navigation event occurs. | ||
*/ | ||
function startListener(history, store) { | ||
// dispatch once on app start | ||
store.dispatch((0, _actions.manualChange)('' + location.pathname + location.search + location.hash)); | ||
store.dispatch((0, _actions.manualChange)(history.location.path)); | ||
// dispatch on history 'POP' actions | ||
history.listen(function (location, action) { | ||
if (action === 'POP') { | ||
store.dispatch((0, _actions.manualChange)('' + location.pathname + location.search + location.hash)); | ||
store.dispatch((0, _actions.manualChange)(location.path)); | ||
} | ||
@@ -24,0 +22,0 @@ }); |
@@ -61,5 +61,3 @@ 'use strict'; | ||
if (router.url !== this.props.router.url) { | ||
this.getNewComponent(routes, router.paths); | ||
} | ||
this.getNewComponent(routes, router.paths); | ||
} | ||
@@ -79,4 +77,3 @@ }, { | ||
params: params, | ||
component: component, | ||
loaded: true | ||
component: component | ||
}); | ||
@@ -83,0 +80,0 @@ }); |
{ | ||
"name": "redux-json-router", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Declarative, Redux-first routing for client-rendered React/Redux applications.", | ||
@@ -29,3 +29,3 @@ "main": "lib/index.js", | ||
"loader-utils": "^1.1.0", | ||
"prop-types": "^15.5.8" | ||
"prop-types": "^15.5.10" | ||
}, | ||
@@ -35,3 +35,3 @@ "devDependencies": { | ||
"babel-core": "^6.24.1", | ||
"babel-eslint": "^7.2.1", | ||
"babel-eslint": "^7.2.3", | ||
"babel-preset-es2015": "^6.24.1", | ||
@@ -44,9 +44,9 @@ "babel-preset-react": "^6.24.1", | ||
"eslint": "^3.19.0", | ||
"eslint-config-airbnb": "^14.1.0", | ||
"eslint-config-airbnb": "^15.0.1", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^4.0.0", | ||
"eslint-plugin-react": "^6.10.3", | ||
"eslint-plugin-jsx-a11y": "^5.0.3", | ||
"eslint-plugin-react": "^7.0.1", | ||
"istanbul": "^1.0.0-alpha.2", | ||
"jsdom": "^9.12.0", | ||
"mocha": "^3.2.0", | ||
"jsdom": "^10.1.0", | ||
"mocha": "^3.4.1", | ||
"react": "^15.5.4", | ||
@@ -58,3 +58,3 @@ "react-dom": "^15.5.4", | ||
"rimraf": "^2.6.1", | ||
"sinon": "^2.1.0" | ||
"sinon": "^2.2.0" | ||
}, | ||
@@ -61,0 +61,0 @@ "peerDependencies": { |
43596
654
Updatedprop-types@^15.5.10