react-whereto
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -18,2 +18,14 @@ "use strict"; | ||
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
const omit = (obj, excludeKey) => Object.keys(obj).reduce((memo, key) => { | ||
if (excludeKey === key) { | ||
return memo; | ||
} | ||
return _extends({}, memo, { | ||
[key]: obj[key] | ||
}); | ||
}, {}); | ||
class DispatcherProviderBase extends _react.default.Component { | ||
@@ -37,10 +49,8 @@ constructor(...args) { | ||
writable: true, | ||
value: prevLocation => { | ||
const { | ||
location | ||
} = this.props.history; | ||
value: location => { | ||
if (!(0, _lodash.default)(omit(location, 'key'), omit(this.lastLocation, 'key'))) { | ||
this.props.dispatcher.getThunkForValidRoutes(location, this.lastLocation)(this.getDispatch()); | ||
} | ||
if (!(0, _lodash.default)(location, prevLocation)) { | ||
this.props.dispatcher.getThunkForValidRoutes(location, prevLocation)(this.getDispatch()); | ||
} | ||
this.lastLocation = location; | ||
} | ||
@@ -54,2 +64,3 @@ }), _temp; | ||
} = this.props; | ||
this.lastLocation = history.location; | ||
this.unsubHistory = history.listen(this.historyUpdate); | ||
@@ -56,0 +67,0 @@ } |
{ | ||
"name": "react-whereto", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "clean": "rimraf lib", |
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
15328
265