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

fela-bindings

Package Overview
Dependencies
Maintainers
2
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela-bindings - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

21

es/connectFactory.js

@@ -0,5 +1,5 @@

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; }; }();
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
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 _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }

@@ -16,2 +16,3 @@

import { combineMultiRules } from 'fela-tools';
import shallowCompare from 'react-addons-shallow-compare';

@@ -21,4 +22,12 @@ import generateDisplayName from './generateDisplayName';

var defaultConfig = {
pure: true
};
export default function connectFactory(BaseComponent, createElement, withTheme, contextTypes) {
return function connect(rules) {
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var connectConfig = _extends({}, defaultConfig, config);
return function (component) {

@@ -35,2 +44,10 @@ var EnhancedComponent = function (_BaseComponent) {

_createClass(EnhancedComponent, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
if (connectConfig.pure) {
return shallowCompare(this, nextProps, nextState);
}
return true;
}
}, {
key: 'render',

@@ -37,0 +54,0 @@ value: function render() {

@@ -7,6 +7,6 @@ '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; }; }();
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
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; }; }();
exports.default = connectFactory;

@@ -24,2 +24,6 @@

var _reactAddonsShallowCompare = require('react-addons-shallow-compare');
var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
var _generateDisplayName = require('./generateDisplayName');

@@ -43,4 +47,12 @@

var defaultConfig = {
pure: true
};
function connectFactory(BaseComponent, createElement, withTheme, contextTypes) {
return function connect(rules) {
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var connectConfig = _extends({}, defaultConfig, config);
return function (component) {

@@ -57,2 +69,10 @@ var EnhancedComponent = function (_BaseComponent) {

_createClass(EnhancedComponent, [{
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
if (connectConfig.pure) {
return (0, _reactAddonsShallowCompare2.default)(this, nextProps, nextState);
}
return true;
}
}, {
key: 'render',

@@ -59,0 +79,0 @@ value: function render() {

11

package.json
{
"name": "fela-bindings",
"version": "2.1.0",
"version": "2.2.0",
"description": "Abstract binding factories for Fela",

@@ -26,10 +26,11 @@ "main": "lib/index.js",

"fast-loops": "^1.0.0",
"fela-dom": "^7.0.6",
"fela-tools": "^5.1.4",
"fela-dom": "^7.0.7",
"fela-tools": "^5.1.5",
"react-addons-shallow-compare": "^15.6.2",
"shallow-equal": "^1.0.0"
},
"devDependencies": {
"fela": "^6.1.5",
"fela-monolithic": "^5.0.20"
"fela": "^6.1.7",
"fela-monolithic": "^5.0.21"
}
}
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