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

pure-render-decorator

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pure-render-decorator - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

.npmignore

23

index.js

@@ -7,4 +7,3 @@ /**

var React = require('react/addons');
var PureRenderMixin = React.addons.PureRenderMixin;
var shallowCompare = require('react-addons-shallow-compare');

@@ -14,9 +13,19 @@

/**
* Makes the given component "pure" using the PureRenderMixin.
* Tells if a component should update given it's next props
* and state.
*
* @param object nextProps Next props.
* @param object nextState Next state.
*/
function shouldComponentUpdate(nextProps, nextState) {
return shallowCompare(this, nextProps, nextState);
}
/**
* Makes the given component "pure".
*
* @param object component Component.
*/
function purify(component) {
component.prototype.shouldComponentUpdate
= PureRenderMixin.shouldComponentUpdate;
function pureRenderDecorator(component) {
component.prototype.shouldComponentUpdate = shouldComponentUpdate;
}

@@ -26,2 +35,2 @@

module.exports = purify;
module.exports = pureRenderDecorator;
{
"name": "pure-render-decorator",
"version": "0.1.0",
"version": "0.2.0",
"description": "Makes React components pure.",

@@ -13,7 +13,16 @@ "keywords": [

"license": "MIT",
"repository" : "felixgirault/pure-render-decorator",
"repository": "felixgirault/pure-render-decorator",
"main": "index.js",
"peerDependencies": {
"react": "*"
"react": "^0.14.0"
},
"dependencies": {
"react-addons-shallow-compare": "^0.14.0"
},
"devDependencies": {
"mocha": "^2.3.3"
},
"scripts": {
"test": "mocha"
}
}

@@ -32,3 +32,3 @@ Pure render decorator

var React = require('react');
var PureRenderMixin = React.addons.PureRenderMixin;
var PureRenderMixin = require('react-addons-pure-render-mixin');

@@ -35,0 +35,0 @@ var Test = React.createClass({

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