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

oo7-react

Package Overview
Dependencies
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oo7-react - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

63

lib/index.js

@@ -70,6 +70,2 @@ 'use strict';

function identity(x) {
x;
}
/**

@@ -104,2 +100,3 @@ * @summary A derivable class for creating React components that can transparently

var ReactiveComponent = function (_React$Component2) {

@@ -126,3 +123,2 @@ _inherits(ReactiveComponent, _React$Component2);

var bonds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var propTransforms = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};

@@ -135,4 +131,4 @@ _classCallCheck(this, ReactiveComponent);

_this2.bonds = bonds;
_this2.propTransforms = propTransforms;
_this2.allBondKeys = [].concat(reactiveProps).concat(Object.keys(bonds));
_this2.state = {};
return _this2;

@@ -186,3 +182,5 @@ }

var bonds = this.bonds;
var bondKeys = Object.keys(bonds);
var bondKeys = Object.keys(bonds).filter(function (k) {
return typeof bonds[k] !== 'function';
});
this._consolidatedExtraBonds = new ReactiveBond(bondKeys.map(function (f) {

@@ -209,2 +207,6 @@ return bonds[f];

}
if (this._derivedBonds) {
this._derivedBonds.drop();
delete this._derivedBonds;
}
}

@@ -222,2 +224,11 @@ }, {

var that = this;
var bonds = this.bonds;
var derivedBondKeys = Object.keys(bonds).filter(function (k) {
return typeof bonds[k] === 'function';
});
if (this._derivedBonds) {
this._derivedBonds.drop();
delete this._derivedBonds;
}
if (this._consolidatedBonds) {

@@ -227,11 +238,31 @@ this._consolidatedBonds.drop();

}
this._consolidatedBonds = new ReactiveBond(this.reactiveProps.map(function (f) {
return (_this3.reactiveProps[f] || identity)(nextProps[f]);
}), [], function (a) {
var s = that.state || {};
that.reactiveProps.forEach(function (f, i) {
s[f] = a[i];
});
that.setState(s);
}).use();
if (that.reactiveProps.length > 0) {
this._consolidatedBonds = new TransformBond(function () {
for (var _len = arguments.length, a = Array(_len), _key = 0; _key < _len; _key++) {
a[_key] = arguments[_key];
}
var s = {};
that.reactiveProps.forEach(function (f, i) {
s[f] = a[i];
});
that.setState(s);
return s;
}, this.reactiveProps.map(function (f) {
return nextProps[f];
}), []).subscriptable().use();
}
if (derivedBondKeys.length > 0) {
this._derivedBonds = new ReactiveBond(derivedBondKeys.map(function (f) {
return bonds[f](_this3._consolidatedBonds);
}), [], function (a) {
var s = {};
derivedBondKeys.forEach(function (f, i) {
return s[f] = a[i];
});
that.setState(s);
}).use();
}
}

@@ -238,0 +269,0 @@

{
"name": "oo7-react",
"version": "0.5.0",
"version": "0.6.0",
"description": "The Reactive Bond API",

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

"dependencies": {
"oo7": "^0.5.9",
"oo7": "file:../oo7",
"react": "^15.4.2"

@@ -36,0 +36,0 @@ },

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