Socket
Socket
Sign inDemoInstall

react-router-redux

Package Overview
Dependencies
3
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0-alpha.8 to 5.0.0-alpha.9

14

ConnectedRouter.js

@@ -48,12 +48,9 @@ 'use strict';

propsStore = _props.store,
history = _props.history;
history = _props.history,
isSSR = _props.isSSR;
this.store = propsStore || this.context.store;
this.handleLocationChange(history.location);
};
ConnectedRouter.prototype.componentDidMount = function componentDidMount() {
var history = this.props.history;
this.unsubscribeFromHistory = history.listen(this.handleLocationChange);
if (!isSSR) this.unsubscribeFromHistory = history.listen(this.handleLocationChange);
};

@@ -74,4 +71,5 @@

store: _propTypes2.default.object,
history: _propTypes2.default.object,
children: _propTypes2.default.node
history: _propTypes2.default.object.isRequired,
children: _propTypes2.default.node,
isSSR: _propTypes2.default.bool
};

@@ -78,0 +76,0 @@ ConnectedRouter.contextTypes = {

@@ -36,12 +36,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

propsStore = _props.store,
history = _props.history;
history = _props.history,
isSSR = _props.isSSR;
this.store = propsStore || this.context.store;
this.handleLocationChange(history.location);
};
ConnectedRouter.prototype.componentDidMount = function componentDidMount() {
var history = this.props.history;
this.unsubscribeFromHistory = history.listen(this.handleLocationChange);
if (!isSSR) this.unsubscribeFromHistory = history.listen(this.handleLocationChange);
};

@@ -62,4 +59,5 @@

store: PropTypes.object,
history: PropTypes.object,
children: PropTypes.node
history: PropTypes.object.isRequired,
children: PropTypes.node,
isSSR: PropTypes.bool
};

@@ -66,0 +64,0 @@ ConnectedRouter.contextTypes = {

@@ -11,4 +11,4 @@ import { matchPath } from 'react-router';

return function (state) {
var _getLocation = getLocation(state),
pathname = _getLocation.pathname;
var _ref = getLocation(state) || {},
pathname = _ref.pathname;

@@ -15,0 +15,0 @@ if (pathname === lastPathname) {

{
"name": "react-router-redux",
"version": "5.0.0-alpha.8",
"version": "5.0.0-alpha.9",
"description": "Redux bindings for React Router",

@@ -40,3 +40,3 @@ "repository": "ReactTraining/react-router",

"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-core": "^6.21.0",
"babel-eslint": "^8.0.1",

@@ -57,3 +57,3 @@ "babel-jest": "^21.2.0",

"react-redux": "^5.0.6",
"react-test-renderer": "^16.0.0",
"react-test-renderer": "^16.1.0",
"redux": "^3.6.0",

@@ -60,0 +60,0 @@ "rollup": "^0.50.0",

@@ -16,4 +16,4 @@ 'use strict';

return function (state) {
var _getLocation = getLocation(state),
pathname = _getLocation.pathname;
var _ref = getLocation(state) || {},
pathname = _ref.pathname;

@@ -20,0 +20,0 @@ if (pathname === lastPathname) {

@@ -70,12 +70,9 @@ (function (global, factory) {

propsStore = _props.store,
history = _props.history;
history = _props.history,
isSSR = _props.isSSR;
this.store = propsStore || this.context.store;
this.handleLocationChange(history.location);
};
ConnectedRouter.prototype.componentDidMount = function componentDidMount() {
var history = this.props.history;
this.unsubscribeFromHistory = history.listen(this.handleLocationChange);
if (!isSSR) this.unsubscribeFromHistory = history.listen(this.handleLocationChange);
};

@@ -96,4 +93,5 @@

store: PropTypes.object,
history: PropTypes.object,
children: PropTypes.node
history: PropTypes.object.isRequired,
children: PropTypes.node,
isSSR: PropTypes.bool
};

@@ -112,4 +110,4 @@ ConnectedRouter.contextTypes = {

return function (state) {
var _getLocation = getLocation(state),
pathname = _getLocation.pathname;
var _ref = getLocation(state) || {},
pathname = _ref.pathname;

@@ -116,0 +114,0 @@ if (pathname === lastPathname) {

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("react-router")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","react-router"],e):e(t.ReactRouterRedux={},t.React,t.PropTypes,t.ReactRouter)}(this,function(t,e,r,o){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function u(t){return function(){for(var e=arguments.length,r=Array(e),o=0;e>o;o++)r[o]=arguments[o];return{type:y,payload:{method:t,args:r}}}}var c="default"in e?e.default:e;r=r&&r.hasOwnProperty("default")?r.default:r;var p=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},s="@@router/LOCATION_CHANGE",l={location:null},f=function(t){function e(){var r,o,i;n(this,e);for(var u=arguments.length,c=Array(u),p=0;u>p;p++)c[p]=arguments[p];return r=o=a(this,t.call.apply(t,[this].concat(c))),o.handleLocationChange=function(t){o.store.dispatch({type:s,payload:t})},i=r,a(o,i)}return i(e,t),e.prototype.componentWillMount=function(){var t=this.props,e=t.store,r=t.history;this.store=e||this.context.store,this.handleLocationChange(r.location)},e.prototype.componentDidMount=function(){var t=this.props.history;this.unsubscribeFromHistory=t.listen(this.handleLocationChange)},e.prototype.componentWillUnmount=function(){this.unsubscribeFromHistory&&this.unsubscribeFromHistory()},e.prototype.render=function(){return c.createElement(o.Router,this.props)},e}(e.Component);f.propTypes={store:r.object,history:r.object,children:r.node},f.contextTypes={store:r.object};var h=function(t){return t.router.location},y="@@router/CALL_HISTORY_METHOD",d=u("push"),b=u("replace"),g=u("go"),v=u("goBack"),O=u("goForward"),m={push:d,replace:b,go:g,goBack:v,goForward:O};t.ConnectedRouter=f,t.routerMiddleware=function(t){return function(){return function(e){return function(r){if(r.type!==y)return e(r);var o=r.payload,n=o.method,a=o.args;t[n].apply(t,a)}}}},t.getLocation=h,t.createMatchSelector=function(t){var e=null,r=null;return function(n){var a=h(n).pathname;if(a===e)return r;e=a;var i=o.matchPath(a,t);return i&&r&&i.url===r.url||(r=i),r}},t.LOCATION_CHANGE=s,t.routerReducer=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.type,o=e.payload;return r===s?p({},t,{location:o}):t},t.CALL_HISTORY_METHOD=y,t.push=d,t.replace=b,t.go=g,t.goBack=v,t.goForward=O,t.routerActions=m,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("react-router")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","react-router"],e):e(t.ReactRouterRedux={},t.React,t.PropTypes,t.ReactRouter)}(this,function(t,e,r,o){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t){return function(){for(var e=arguments.length,r=Array(e),o=0;e>o;o++)r[o]=arguments[o];return{type:f,payload:{method:t,args:r}}}}var i="default"in e?e.default:e;r=r&&r.hasOwnProperty("default")?r.default:r;var u=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},c="@@router/LOCATION_CHANGE",s={location:null},p=function(t){function e(){var r,o,a;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var i=arguments.length,u=Array(i),s=0;i>s;s++)u[s]=arguments[s];return r=o=n(this,t.call.apply(t,[this].concat(u))),o.handleLocationChange=function(t){o.store.dispatch({type:c,payload:t})},a=r,n(o,a)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentWillMount=function(){var t=this.props,e=t.history,r=t.isSSR;this.store=t.store||this.context.store,this.handleLocationChange(e.location),r||(this.unsubscribeFromHistory=e.listen(this.handleLocationChange))},e.prototype.componentWillUnmount=function(){this.unsubscribeFromHistory&&this.unsubscribeFromHistory()},e.prototype.render=function(){return i.createElement(o.Router,this.props)},e}(e.Component);p.propTypes={store:r.object,history:r.object.isRequired,children:r.node,isSSR:r.bool},p.contextTypes={store:r.object};var l=function(t){return t.router.location},f="@@router/CALL_HISTORY_METHOD",h=a("push"),y=a("replace"),d=a("go"),b=a("goBack"),g=a("goForward"),v={push:h,replace:y,go:d,goBack:b,goForward:g};t.ConnectedRouter=p,t.routerMiddleware=function(t){return function(){return function(e){return function(r){if(r.type!==f)return e(r);var o=r.payload;t[o.method].apply(t,o.args)}}}},t.getLocation=l,t.createMatchSelector=function(t){var e=null,r=null;return function(n){var a=(l(n)||{}).pathname;if(a===e)return r;e=a;var i=o.matchPath(a,t);return i&&r&&i.url===r.url||(r=i),r}},t.LOCATION_CHANGE=c,t.routerReducer=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.type===c?u({},t,{location:e.payload}):t},t.CALL_HISTORY_METHOD=f,t.push=h,t.replace=y,t.go=d,t.goBack=b,t.goForward=g,t.routerActions=v,Object.defineProperty(t,"__esModule",{value:!0})});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc