Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-isomorphic-tools

Package Overview
Dependencies
Maintainers
1
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-isomorphic-tools - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

4

actions/preload.js

@@ -9,3 +9,3 @@ 'use strict';

params = _ref.params,
location = _ref.location;
query = _ref.query;
return function (dispatch) {

@@ -17,3 +17,3 @@ dispatch({

params: params,
location: location
query: query
}

@@ -20,0 +20,0 @@ });

@@ -39,3 +39,3 @@ 'use strict';

props = (0, _objectWithoutProperties3.default)(_ref2$renderProps, ['components', 'routes', 'params', 'location', 'router']);
var i, test;
var i;
return _regenerator2.default.wrap(function _callee$(_context) {

@@ -46,10 +46,9 @@ while (1) {

components = (0, _preload2.getComponents)(components);
console.log(components.length);
if (!components.length) {
_context.next = 23;
_context.next = 19;
break;
}
_context.prev = 3;
_context.prev = 2;

@@ -59,5 +58,5 @@ dispatch((0, _preload.start)());

case 6:
case 5:
if ((_context.t1 = _context.t0()).done) {
_context.next = 17;
_context.next = 13;
break;

@@ -69,8 +68,7 @@ }

if (!components.hasOwnProperty(i)) {
_context.next = 15;
_context.next = 11;
break;
}
console.log(components[i], components[i].preload);
_context.next = 12;
_context.next = 10;
return components[i].preload({

@@ -89,28 +87,25 @@ getState: getState,

case 12:
test = _context.sent;
console.log(test);
case 10:
dispatch((0, _preload.push)({
displayName: components[i].displayName,
params: params,
location: location
query: location.query
}));
case 15:
_context.next = 6;
case 11:
_context.next = 5;
break;
case 17:
case 13:
dispatch((0, _preload.finish)());
_context.next = 23;
_context.next = 19;
break;
case 20:
_context.prev = 20;
_context.t2 = _context['catch'](3);
case 16:
_context.prev = 16;
_context.t2 = _context['catch'](2);
dispatch((0, _preload.error)(_context.t2));
case 23:
case 19:
case 'end':

@@ -120,3 +115,3 @@ return _context.stop();

}
}, _callee, undefined, [[3, 20]]);
}, _callee, undefined, [[2, 16]]);
}));

@@ -123,0 +118,0 @@

@@ -133,3 +133,3 @@ 'use strict';

params = _ref4.params,
location = _ref4.location;
query = _ref4.query;

@@ -143,3 +143,3 @@ var state = getState();

if (item.name == displayName) {
return _lodash2.default.isEqual(item.params, params) && _lodash2.default.isEqual(location.query, item.location.query);
return _lodash2.default.isEqual(item.params, params) && _lodash2.default.isEqual(query, item.query);
}

@@ -146,0 +146,0 @@ }) != -1;

{
"name": "react-isomorphic-tools",
"version": "1.0.5",
"version": "1.0.6",
"description": "Authorization, Fetcher, Preload. Tools for ServerSide rendering",

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

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

const push = ({displayName, params, location}) => dispatch => {
const push = ({displayName, params, query}) => dispatch => {
dispatch({

@@ -7,3 +7,3 @@ type: '@@preload/push',

params,
location
query
}

@@ -10,0 +10,0 @@ })

@@ -8,3 +8,2 @@ import {push, start, finish, error} from '../actions/preload'

components = getComponents(components)
console.log(components.length)
if (components.length) {

@@ -15,4 +14,3 @@ try {

if (components.hasOwnProperty(i)) {
console.log(components[i], components[i].preload)
const test = await components[i].preload({
await components[i].preload({
getState,

@@ -27,7 +25,6 @@ dispatch,

}, props)
console.log(test)
dispatch(push({
displayName: components[i].displayName,
params,
location
query: location.query
}))

@@ -34,0 +31,0 @@ }

@@ -46,3 +46,3 @@ import lodash from 'lodash'

const isLoaded = (displayName, {getState, params, location}) => {
const isLoaded = (displayName, {getState, params, query}) => {
const state = getState()

@@ -53,3 +53,3 @@ const {preload} = Immutable.Map.isMap(state) ? state.toJS() : state

if (item.name == displayName) {
return lodash.isEqual(item.params, params) && lodash.isEqual(location.query, item.location.query)
return lodash.isEqual(item.params, params) && lodash.isEqual(query, item.query)
}

@@ -56,0 +56,0 @@ }) != -1

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