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.5 to 4.0.6

README.md

4

CHANGELOG.md

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

## [4.0.6](https://github.com/reactjs/react-router-redux/compare/v4.0.5...v4.0.6)
- Makes sure the state in the store matches the state in history when using SSR [#445](https://github.com/reactjs/react-router-redux/pull/445)
## [4.0.5](https://github.com/reactjs/react-router-redux/compare/v4.0.4...v4.0.5)

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

8

dist/ReactRouterRedux.js

@@ -310,2 +310,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

var unsubscribeFromHistory = void 0;
var currentLocation = void 0;

@@ -318,4 +319,4 @@ // What does the store say about current location?

// Init currentLocation with potential location in store
var currentLocation = getLocationInStore();
// Init initialLocation with potential location in store
initialLocation = getLocationInStore();

@@ -326,3 +327,3 @@ // If the store is replayed, update the URL in the browser to match.

var locationInStore = getLocationInStore(true);
if (currentLocation === locationInStore) {
if (currentLocation === locationInStore || initialLocation === locationInStore) {
return;

@@ -376,3 +377,2 @@ }

// The listeners are subscribed to the store instead of history
listen: function listen(listener) {

@@ -379,0 +379,0 @@ // Copy of last location.

@@ -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 f=void 0,d=void 0,l=void 0,p=void 0,y=function(e){var t=a(r.getState());return t.locationBeforeTransitions||(e?f:void 0)},v=y();if(s){var O=function(){var r=y(!0);v!==r&&(d=!0,v=r,e.transitionTo(n({},r,{action:"PUSH"})),d=!1)};l=r.subscribe(O),O()}var g=function(e){d||(v=e,!f&&(f=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;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}}])});

@@ -46,2 +46,3 @@ 'use strict';

var unsubscribeFromHistory = void 0;
var currentLocation = void 0;

@@ -54,4 +55,4 @@ // What does the store say about current location?

// Init currentLocation with potential location in store
var currentLocation = getLocationInStore();
// Init initialLocation with potential location in store
initialLocation = getLocationInStore();

@@ -62,3 +63,3 @@ // If the store is replayed, update the URL in the browser to match.

var locationInStore = getLocationInStore(true);
if (currentLocation === locationInStore) {
if (currentLocation === locationInStore || initialLocation === locationInStore) {
return;

@@ -112,3 +113,2 @@ }

// The listeners are subscribed to the store instead of history
listen: function listen(listener) {

@@ -115,0 +115,0 @@ // Copy of last location.

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

@@ -5,0 +5,0 @@ "main": "lib/index",

@@ -37,2 +37,3 @@ import { LOCATION_CHANGE } from './reducer'

let unsubscribeFromHistory
let currentLocation

@@ -46,4 +47,4 @@ // What does the store say about current location?

// Init currentLocation with potential location in store
let currentLocation = getLocationInStore()
// Init initialLocation with potential location in store
initialLocation = getLocationInStore()

@@ -54,3 +55,3 @@ // If the store is replayed, update the URL in the browser to match.

const locationInStore = getLocationInStore(true)
if (currentLocation === locationInStore) {
if (currentLocation === locationInStore || initialLocation === locationInStore) {
return

@@ -57,0 +58,0 @@ }

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