Socket
Socket
Sign inDemoInstall

react-router-redux

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router-redux - npm Package Compare versions

Comparing version 4.0.6 to 4.0.7

4

CHANGELOG.md

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

## [4.0.7](https://github.com/reactjs/react-router-redux/compare/v4.0.6...v4.0.7)
- Support history 3 [#476](https://github.com/reactjs/react-router-redux/pull/476)
## [4.0.6](https://github.com/reactjs/react-router-redux/compare/v4.0.5...v4.0.6)

@@ -2,0 +6,0 @@

31

dist/ReactRouterRedux.js

@@ -209,9 +209,8 @@ (function webpackUniversalModuleDefinition(root, factory) {

function routerReducer() {
var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0];
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
type = _ref.type,
payload = _ref.payload;
var type = _ref.type;
var payload = _ref.payload;
if (type === LOCATION_CHANGE) {

@@ -252,5 +251,5 @@ return _extends({}, state, { locationBeforeTransitions: payload });

var _action$payload = action.payload;
var method = _action$payload.method;
var args = _action$payload.args;
var _action$payload = action.payload,
method = _action$payload.method,
args = _action$payload.args;

@@ -296,9 +295,8 @@ history[method].apply(history, _toConsumableArray(args));

function syncHistoryWithStore(history, store) {
var _ref = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref$selectLocationSt = _ref.selectLocationState,
selectLocationState = _ref$selectLocationSt === undefined ? defaultSelectLocationState : _ref$selectLocationSt,
_ref$adjustUrlOnRepla = _ref.adjustUrlOnReplay,
adjustUrlOnReplay = _ref$adjustUrlOnRepla === undefined ? true : _ref$adjustUrlOnRepla;
var _ref$selectLocationSt = _ref.selectLocationState;
var selectLocationState = _ref$selectLocationSt === undefined ? defaultSelectLocationState : _ref$selectLocationSt;
var _ref$adjustUrlOnRepla = _ref.adjustUrlOnReplay;
var adjustUrlOnReplay = _ref$adjustUrlOnRepla === undefined ? true : _ref$adjustUrlOnRepla;
// Ensure that the reducer is mounted on the store and functioning properly.

@@ -374,2 +372,7 @@ if (typeof selectLocationState(store.getState()) === 'undefined') {

// support history 3.x
if (history.getCurrentLocation) {
handleLocationChange(history.getCurrentLocation());
}
// The enhanced history uses store as source of truth

@@ -376,0 +379,0 @@ return _extends({}, history, {

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

!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.ReactRouterRedux=r():e.ReactRouterRedux=r()}(this,function(){return function(e){function r(o){if(t[o])return t[o].exports;var n=t[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}var t={};return r.m=e,r.c=t,r.p="",r(0)}([function(e,r,t){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(r,"__esModule",{value:!0}),r.routerMiddleware=r.routerActions=r.goForward=r.goBack=r.go=r.replace=r.push=r.CALL_HISTORY_METHOD=r.routerReducer=r.LOCATION_CHANGE=r.syncHistoryWithStore=void 0;var n=t(2);Object.defineProperty(r,"LOCATION_CHANGE",{enumerable:!0,get:function(){return n.LOCATION_CHANGE}}),Object.defineProperty(r,"routerReducer",{enumerable:!0,get:function(){return n.routerReducer}});var u=t(1);Object.defineProperty(r,"CALL_HISTORY_METHOD",{enumerable:!0,get:function(){return u.CALL_HISTORY_METHOD}}),Object.defineProperty(r,"push",{enumerable:!0,get:function(){return u.push}}),Object.defineProperty(r,"replace",{enumerable:!0,get:function(){return u.replace}}),Object.defineProperty(r,"go",{enumerable:!0,get:function(){return u.go}}),Object.defineProperty(r,"goBack",{enumerable:!0,get:function(){return u.goBack}}),Object.defineProperty(r,"goForward",{enumerable:!0,get:function(){return u.goForward}}),Object.defineProperty(r,"routerActions",{enumerable:!0,get:function(){return u.routerActions}});var i=t(4),a=o(i),c=t(3),s=o(c);r.syncHistoryWithStore=a["default"],r.routerMiddleware=s["default"]},function(e,r){"use strict";function t(e){return function(){for(var r=arguments.length,t=Array(r),n=0;r>n;n++)t[n]=arguments[n];return{type:o,payload:{method:e,args:t}}}}Object.defineProperty(r,"__esModule",{value:!0});var o=r.CALL_HISTORY_METHOD="@@router/CALL_HISTORY_METHOD",n=r.push=t("push"),u=r.replace=t("replace"),i=r.go=t("go"),a=r.goBack=t("goBack"),c=r.goForward=t("goForward");r.routerActions={push:n,replace:u,go:i,goBack:a,goForward:c}},function(e,r){"use strict";function t(){var e=arguments.length<=0||void 0===arguments[0]?u:arguments[0],r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],t=r.type,i=r.payload;return t===n?o({},e,{locationBeforeTransitions:i}):e}Object.defineProperty(r,"__esModule",{value:!0});var o=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};r.routerReducer=t;var n=r.LOCATION_CHANGE="@@router/LOCATION_CHANGE",u={locationBeforeTransitions:null}},function(e,r,t){"use strict";function o(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)}function n(e){return function(){return function(r){return function(t){if(t.type!==u.CALL_HISTORY_METHOD)return r(t);var n=t.payload,i=n.method,a=n.args;e[i].apply(e,o(a))}}}}Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=n;var u=t(1)},function(e,r,t){"use strict";function o(e,r){var t=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],o=t.selectLocationState,a=void 0===o?i:o,c=t.adjustUrlOnReplay,s=void 0===c?!0:c;if("undefined"==typeof a(r.getState()))throw new Error("Expected the routing state to be available either as `state.routing` or as the custom expression you can specify as `selectLocationState` in the `syncHistoryWithStore()` options. Ensure you have added the `routerReducer` to your store's reducers via `combineReducers` or whatever method you use to isolate your reducers.");var d=void 0,f=void 0,l=void 0,p=void 0,v=void 0,y=function(e){var t=a(r.getState());return t.locationBeforeTransitions||(e?d:void 0)};if(d=y(),s){var O=function(){var r=y(!0);v!==r&&d!==r&&(f=!0,v=r,e.transitionTo(n({},r,{action:"PUSH"})),f=!1)};l=r.subscribe(O),O()}var g=function(e){f||(v=e,!d&&(d=e,y())||r.dispatch({type:u.LOCATION_CHANGE,payload:e}))};return p=e.listen(g),n({},e,{listen:function(e){var t=y(!0),o=!1,n=r.subscribe(function(){var r=y(!0);r!==t&&(t=r,o||e(t))});return e(t),function(){o=!0,n()}},unsubscribe:function(){s&&l(),p()}})}Object.defineProperty(r,"__esModule",{value:!0});var n=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};r["default"]=o;var u=t(2),i=function(e){return e.routing}}])});
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.ReactRouterRedux=r():e.ReactRouterRedux=r()}(this,function(){return function(e){function r(o){if(t[o])return t[o].exports;var n=t[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}var t={};return r.m=e,r.c=t,r.p="",r(0)}([function(e,r,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.routerMiddleware=r.routerActions=r.goForward=r.goBack=r.go=r.replace=r.push=r.CALL_HISTORY_METHOD=r.routerReducer=r.LOCATION_CHANGE=r.syncHistoryWithStore=void 0;var n=t(2);Object.defineProperty(r,"LOCATION_CHANGE",{enumerable:!0,get:function(){return n.LOCATION_CHANGE}}),Object.defineProperty(r,"routerReducer",{enumerable:!0,get:function(){return n.routerReducer}});var u=t(1);Object.defineProperty(r,"CALL_HISTORY_METHOD",{enumerable:!0,get:function(){return u.CALL_HISTORY_METHOD}}),Object.defineProperty(r,"push",{enumerable:!0,get:function(){return u.push}}),Object.defineProperty(r,"replace",{enumerable:!0,get:function(){return u.replace}}),Object.defineProperty(r,"go",{enumerable:!0,get:function(){return u.go}}),Object.defineProperty(r,"goBack",{enumerable:!0,get:function(){return u.goBack}}),Object.defineProperty(r,"goForward",{enumerable:!0,get:function(){return u.goForward}}),Object.defineProperty(r,"routerActions",{enumerable:!0,get:function(){return u.routerActions}});var i=t(4),a=o(i),c=t(3),s=o(c);r.syncHistoryWithStore=a.default,r.routerMiddleware=s.default},function(e,r){"use strict";function t(e){return function(){for(var r=arguments.length,t=Array(r),n=0;n<r;n++)t[n]=arguments[n];return{type:o,payload:{method:e,args:t}}}}Object.defineProperty(r,"__esModule",{value:!0});var o=r.CALL_HISTORY_METHOD="@@router/CALL_HISTORY_METHOD",n=r.push=t("push"),u=r.replace=t("replace"),i=r.go=t("go"),a=r.goBack=t("goBack"),c=r.goForward=t("goForward");r.routerActions={push:n,replace:u,go:i,goBack:a,goForward:c}},function(e,r){"use strict";function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.type,i=r.payload;return t===n?o({},e,{locationBeforeTransitions:i}):e}Object.defineProperty(r,"__esModule",{value:!0});var o=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};r.routerReducer=t;var n=r.LOCATION_CHANGE="@@router/LOCATION_CHANGE",u={locationBeforeTransitions:null}},function(e,r,t){"use strict";function o(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}return Array.from(e)}function n(e){return function(){return function(r){return function(t){if(t.type!==u.CALL_HISTORY_METHOD)return r(t);var n=t.payload,i=n.method,a=n.args;e[i].apply(e,o(a))}}}}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n;var u=t(1)},function(e,r,t){"use strict";function o(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.selectLocationState,a=void 0===o?i:o,c=t.adjustUrlOnReplay,s=void 0===c||c;if("undefined"==typeof a(r.getState()))throw new Error("Expected the routing state to be available either as `state.routing` or as the custom expression you can specify as `selectLocationState` in the `syncHistoryWithStore()` options. Ensure you have added the `routerReducer` to your store's reducers via `combineReducers` or whatever method you use to isolate your reducers.");var d=void 0,f=void 0,l=void 0,p=void 0,v=void 0,y=function(e){var t=a(r.getState());return t.locationBeforeTransitions||(e?d:void 0)};if(d=y(),s){var g=function(){var r=y(!0);v!==r&&d!==r&&(f=!0,v=r,e.transitionTo(n({},r,{action:"PUSH"})),f=!1)};l=r.subscribe(g),g()}var O=function(e){f||(v=e,!d&&(d=e,y())||r.dispatch({type:u.LOCATION_CHANGE,payload:e}))};return p=e.listen(O),e.getCurrentLocation&&O(e.getCurrentLocation()),n({},e,{listen:function(e){var t=y(!0),o=!1,n=r.subscribe(function(){var r=y(!0);r!==t&&(t=r,o||e(t))});return e(t),function(){o=!0,n()}},unsubscribe:function(){s&&l(),p()}})}Object.defineProperty(r,"__esModule",{value:!0});var n=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};r.default=o;var u=t(2),i=function(e){return e.routing}}])});

@@ -25,5 +25,5 @@ 'use strict';

var _action$payload = action.payload;
var method = _action$payload.method;
var args = _action$payload.args;
var _action$payload = action.payload,
method = _action$payload.method,
args = _action$payload.args;

@@ -30,0 +30,0 @@ history[method].apply(history, _toConsumableArray(args));

@@ -27,9 +27,8 @@ 'use strict';

function routerReducer() {
var state = arguments.length <= 0 || arguments[0] === undefined ? initialState : arguments[0];
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
type = _ref.type,
payload = _ref.payload;
var type = _ref.type;
var payload = _ref.payload;
if (type === LOCATION_CHANGE) {

@@ -36,0 +35,0 @@ return _extends({}, state, { locationBeforeTransitions: payload });

@@ -30,9 +30,8 @@ 'use strict';

function syncHistoryWithStore(history, store) {
var _ref = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref$selectLocationSt = _ref.selectLocationState,
selectLocationState = _ref$selectLocationSt === undefined ? defaultSelectLocationState : _ref$selectLocationSt,
_ref$adjustUrlOnRepla = _ref.adjustUrlOnReplay,
adjustUrlOnReplay = _ref$adjustUrlOnRepla === undefined ? true : _ref$adjustUrlOnRepla;
var _ref$selectLocationSt = _ref.selectLocationState;
var selectLocationState = _ref$selectLocationSt === undefined ? defaultSelectLocationState : _ref$selectLocationSt;
var _ref$adjustUrlOnRepla = _ref.adjustUrlOnReplay;
var adjustUrlOnReplay = _ref$adjustUrlOnRepla === undefined ? true : _ref$adjustUrlOnRepla;
// Ensure that the reducer is mounted on the store and functioning properly.

@@ -108,2 +107,7 @@ if (typeof selectLocationState(store.getState()) === 'undefined') {

// support history 3.x
if (history.getCurrentLocation) {
handleLocationChange(history.getCurrentLocation());
}
// The enhanced history uses store as source of truth

@@ -110,0 +114,0 @@ return _extends({}, history, {

{
"name": "react-router-redux",
"version": "4.0.6",
"version": "4.0.7",
"description": "Ruthlessly simple bindings to keep react-router and redux in sync",

@@ -59,3 +59,3 @@ "main": "lib/index",

"expect": "^1.13.0",
"history": "^2.0.0",
"history": "^3.0.0",
"isparta": "^4.0.0",

@@ -77,3 +77,3 @@ "isparta-loader": "^2.0.0",

"react-redux": "^4.4.0",
"react-router": "^2.0.0",
"react-router": "^3.0.0",
"redux": "^3.0.4",

@@ -80,0 +80,0 @@ "redux-devtools": "^3.0.0",

@@ -23,4 +23,2 @@ # react-router-redux

If you want to install the next major version, use `react-router-redux@next`. Run `npm dist-tag ls react-router-redux` to see what `next` is aliased to.
## How It Works

@@ -167,3 +165,4 @@

Action creators that correspond with the [history methods of the same name](https://github.com/reactjs/history/blob/master/docs/GettingStarted.md#navigation). For reference they are defined as follows:
Action creators that correspond with the [history methods of the same name]
(https://github.com/mjackson/history/blob/master/README.md#navigation). For reference they are defined as follows:

@@ -176,3 +175,3 @@ - `push` - Pushes a new location to history, becoming the current location.

Both `push` and `replace` take in a [location descriptor](https://github.com/reactjs/history/blob/master/docs/Glossary.md#locationdescriptor), which can be an object describing the URL or a plain string URL.
Both `push` and `replace` take in a [location descriptor](https://github.com/mjackson/history/blob/v2.x/docs/Glossary.md#locationdescriptor), which can be an object describing the URL or a plain string URL.

@@ -179,0 +178,0 @@ These action creators are also available in one single object as `routerActions`, which can be used as a convenience when using Redux's `bindActionCreators()`.

@@ -100,2 +100,7 @@ import { LOCATION_CHANGE } from './reducer'

// support history 3.x
if(history.getCurrentLocation) {
handleLocationChange(history.getCurrentLocation())
}
// The enhanced history uses store as source of truth

@@ -102,0 +107,0 @@ return {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc