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

react-refect

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-refect - npm Package Compare versions

Comparing version 0.1.0-alpha.7 to 0.1.0-alpha.8

25

lib/index.js

@@ -58,2 +58,19 @@ 'use strict';

function shallowEqual(a, b) {
/* eslint-disable no-restricted-syntax */
for (var key in a) {
if ({}.hasOwnProperty.call(a, key) && (!{}.hasOwnProperty.call(b, key) || a[key] !== b[key])) {
return false;
}
}
for (var _key in b) {
if ({}.hasOwnProperty.call(b, _key) && !{}.hasOwnProperty.call(a, _key)) {
return false;
}
}
return true;
}
function refect(options) {

@@ -128,2 +145,10 @@ var _class, _temp;

}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(props, state) {
var finalProps = (state.storeState, props, state.storeAllState);
var thisFinalProps = mapStateToProps(this.state.storeState, this.props, this.state.storeAllState);
return !shallowEqual(finalProps, thisFinalProps);
}
}, {
key: 'componentWillUnmount',

@@ -130,0 +155,0 @@ value: function componentWillUnmount() {

2

package.json
{
"name": "react-refect",
"version": "0.1.0-alpha.7",
"version": "0.1.0-alpha.8",
"description": "",

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

@@ -25,2 +25,19 @@ import React, { Component, PropTypes } from 'react';

function shallowEqual(a, b) {
/* eslint-disable no-restricted-syntax */
for (const key in a) {
if ({}.hasOwnProperty.call(a, key) && (!{}.hasOwnProperty.call(b, key) || a[key] !== b[key])) {
return false;
}
}
for (const key in b) {
if ({}.hasOwnProperty.call(b, key) && !{}.hasOwnProperty.call(a, key)) {
return false;
}
}
return true;
}
export default function refect(options) {

@@ -100,2 +117,10 @@ const { mapStateToProps = defaultMapStateToProps, view, initialState } = options;

shouldComponentUpdate(props, state) {
const finalProps = (state.storeState, props, state.storeAllState);
const thisFinalProps = mapStateToProps(this.state.storeState,
this.props, this.state.storeAllState);
return !shallowEqual(finalProps, thisFinalProps);
}
componentWillUnmount() {

@@ -102,0 +127,0 @@ const actions = this.actions;

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