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

react-side-effect

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-side-effect - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

48

lib/index.js
'use strict';
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = require('react');

@@ -23,2 +15,10 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
module.exports = function withSideEffect(reducePropsToState, handleStateChangeOnClient, mapStateOnServer) {

@@ -45,3 +45,3 @@ if (typeof reducePropsToState !== 'function') {

var mountedInstances = [];
var state = undefined;
var state = void 0;

@@ -60,3 +60,3 @@ function emitChange() {

var SideEffect = (function (_Component) {
var SideEffect = function (_Component) {
_inherits(SideEffect, _Component);

@@ -67,5 +67,6 @@

_Component.apply(this, arguments);
return _possibleConstructorReturn(this, _Component.apply(this, arguments));
}
// Try to use displayName of wrapped component
SideEffect.peek = function peek() {

@@ -75,2 +76,5 @@ return state;

// Expose canUseDOM so tests can monkeypatch it
SideEffect.rewind = function rewind() {

@@ -88,3 +92,3 @@ if (SideEffect.canUseDOM) {

SideEffect.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {
return !_shallowequal2['default'](nextProps, this.props);
return !(0, _shallowequal2.default)(nextProps, this.props);
};

@@ -108,24 +112,14 @@

SideEffect.prototype.render = function render() {
return _react2['default'].createElement(WrappedComponent, this.props);
return _react2.default.createElement(WrappedComponent, this.props);
};
_createClass(SideEffect, null, [{
key: 'displayName',
return SideEffect;
}(_react.Component);
// Try to use displayName of wrapped component
value: 'SideEffect(' + getDisplayName(WrappedComponent) + ')',
SideEffect.displayName = 'SideEffect(' + getDisplayName(WrappedComponent) + ')';
SideEffect.canUseDOM = _exenv2.default.canUseDOM;
// Expose canUseDOM so tests can monkeypatch it
enumerable: true
}, {
key: 'canUseDOM',
value: _exenv2['default'].canUseDOM,
enumerable: true
}]);
return SideEffect;
})(_react.Component);
return SideEffect;
};
};
{
"name": "react-side-effect",
"version": "1.1.0",
"version": "1.1.1",
"description": "Create components whose prop changes map to a global side effect",

@@ -30,13 +30,24 @@ "main": "lib/index.js",

"homepage": "https://github.com/gaearon/react-side-effect",
"contributors": [
"Louis DeScioli <louis.descioli@gmail.com>"
],
"dependencies": {
"exenv": "^1.2.1",
"shallowequal": "^0.2.2"
"shallowequal": "^1.0.0"
},
"devDependencies": {
"babel": "^5.8.23",
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"babel-preset-stage-2": "^6.18.0",
"babel-register": "^6.18.0",
"chai": "^3.2.0",
"isparta": "^3.0.4",
"jsdom": "^6.3.0",
"mocha": "^2.3.0",
"react": "^0.13.3",
"enzyme": "^2.7.0",
"isparta": "^4.0.0",
"jsdom": "^9.9.1",
"mocha": "^3.2.0",
"react": "^15.4.2",
"react-addons-test-utils": "^15.4.2",
"react-dom": "^15.4.2",
"rimraf": "^2.4.3"

@@ -43,0 +54,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