react-side-effect
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -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); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11197
2
125
1
+ Addedexenv@^1.2.1
+ Addedshallowequal@^0.2.2
+ Addedexenv@1.2.2(transitive)
+ Addedlodash._getnative@3.9.1(transitive)
+ Addedlodash.isarguments@3.1.0(transitive)
+ Addedlodash.isarray@3.0.4(transitive)
+ Addedlodash.keys@3.1.2(transitive)
+ Addedshallowequal@0.2.2(transitive)
- Removedfbjs@0.1.0-alpha.10
- Removedasap@2.0.6(transitive)
- Removedcore-js@1.2.7(transitive)
- Removedfbjs@0.1.0-alpha.10(transitive)
- Removedpromise@7.3.1(transitive)
- Removedwhatwg-fetch@0.9.0(transitive)