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.0.2 to 1.1.0

14

lib/index.js

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

var _fbjsLibExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
var _exenv = require('exenv');
var _fbjsLibExecutionEnvironment2 = _interopRequireDefault(_fbjsLibExecutionEnvironment);
var _exenv2 = _interopRequireDefault(_exenv);
var _fbjsLibShallowEqual = require('fbjs/lib/shallowEqual');
var _shallowequal = require('shallowequal');
var _fbjsLibShallowEqual2 = _interopRequireDefault(_fbjsLibShallowEqual);
var _shallowequal2 = _interopRequireDefault(_shallowequal);

@@ -74,3 +74,3 @@ module.exports = function withSideEffect(reducePropsToState, handleStateChangeOnClient, mapStateOnServer) {

if (SideEffect.canUseDOM) {
throw new Error('You may ony call rewind() on the server. Call peek() to read the current state.');
throw new Error('You may only call rewind() on the server. Call peek() to read the current state.');
}

@@ -85,3 +85,3 @@

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

@@ -118,3 +118,3 @@

key: 'canUseDOM',
value: _fbjsLibExecutionEnvironment2['default'].canUseDOM,
value: _exenv2['default'].canUseDOM,
enumerable: true

@@ -121,0 +121,0 @@ }]);

{
"name": "react-side-effect",
"version": "1.0.2",
"version": "1.1.0",
"description": "Create components whose prop changes map to a global side effect",

@@ -31,3 +31,4 @@ "main": "lib/index.js",

"dependencies": {
"fbjs": "0.1.0-alpha.10"
"exenv": "^1.2.1",
"shallowequal": "^0.2.2"
},

@@ -34,0 +35,0 @@ "devDependencies": {

@@ -15,3 +15,3 @@ # React Side Effect

* Setting `document.style.overflow` or background color depending on current screen;
* Setting `document.body.style.margin` or background color depending on current screen;
* Firing Flux actions using declarative API depending on current screen;

@@ -65,5 +65,3 @@ * Some crazy stuff I haven't thought about.

function handleStateChangeOnClient(style) {
for (var key in style) {
document.style[key] = style[key];
}
Object.assign(document.body.style, style);
}

@@ -100,3 +98,3 @@

class DocumentTitle extends Component {
render: function render() {
render() {
if (this.props.children) {

@@ -103,0 +101,0 @@ return Children.only(this.props.children);

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