flux-router-component
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -1,2 +0,3 @@ | ||
var debug = require('debug')('navigateAction'); | ||
var debug = require('debug')('navigateAction'), | ||
url = require('url'); | ||
@@ -17,2 +18,8 @@ module.exports = function (context, payload, done) { | ||
} | ||
// add parsed query parameter object to route object, | ||
// and make it part of CHANGE_ROUTE_XXX action payload. | ||
var parsed = route.path && url.parse(route.path, true); | ||
route.query = (parsed && parsed.query) || {}; | ||
debug('dispatching CHANGE_ROUTE', route); | ||
@@ -19,0 +26,0 @@ context.dispatch('CHANGE_ROUTE_START', route); |
@@ -60,3 +60,4 @@ /** | ||
/** | ||
* Gets the path string (or hash fragment for old browsers that don't support pushState). | ||
* Gets the path string (or hash fragment for old browsers that don't support pushState), | ||
* including the pathname and search query (if it exists). | ||
* @method getPath | ||
@@ -66,6 +67,7 @@ * @return {String} The path string that denotes current route path | ||
getPath: function () { | ||
var path = this.win.location.pathname, | ||
hash; | ||
if (!this._hasPushState && (hash = this.getHash())) { | ||
return hash; | ||
var location = this.win.location, | ||
path = location.pathname + location.search; | ||
if (!this._hasPushState) { | ||
return this.getHash() || path; | ||
} | ||
@@ -72,0 +74,0 @@ return path; |
{ | ||
"name": "flux-router-component", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Router-related React component and mixin for applications with Flux architecture", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17598
282