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

cerebral

Package Overview
Dependencies
Maintainers
5
Versions
638
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cerebral - npm Package Compare versions

Comparing version 5.0.3-1541875455582 to 5.0.3-1541966974774

27

es/Compute.js

@@ -101,3 +101,12 @@ var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };

value: function onSubscription() {
var _this2 = this;
this.isDirty = true;
this.subscribers.filter(function (subscriber) {
return subscriber.watcher !== _this2;
}).forEach(function (subscriber) {
if (subscriber.watcher instanceof Compute) {
subscriber.watcher.onSubscription();
}
});
}

@@ -107,3 +116,3 @@ }, {

value: function compute() {
var _this2 = this;
var _this3 = this;

@@ -117,3 +126,3 @@ this.executedCount++;

}).map(function (computed) {
return computed.subscribe(_this2, _this2.onSubscription);
return computed.subscribe(_this3, _this3.onSubscription);
});

@@ -138,3 +147,3 @@ }

value: function parseDependencies(tag) {
var _this3 = this;
var _this4 = this;

@@ -148,7 +157,7 @@ if (!(tag instanceof Tag)) {

if (tag.type === 'props') {
_this3.propsTags.push(tag);
} else if (tag.type === 'state' && isComputedValue(tag.getValue(_this3.getters))) {
_this3.computedTags.push(tag);
_this4.propsTags.push(tag);
} else if (tag.type === 'state' && isComputedValue(tag.getValue(_this4.getters))) {
_this4.computedTags.push(tag);
} else {
_this3.stateTags.push(tag);
_this4.stateTags.push(tag);
}

@@ -178,3 +187,3 @@ });

value: function hasChangedProps(props) {
var _this4 = this;
var _this5 = this;

@@ -188,3 +197,3 @@ var nextGetters = this.controller.createContext(props);

return tag.getValue(_this4.getters) !== tag.getValue(nextGetters);
return tag.getValue(_this5.getters) !== tag.getValue(nextGetters);
}, false);

@@ -191,0 +200,0 @@ }

@@ -63,3 +63,3 @@ 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; }; }();

_this.version = "5.0.3-1541875455582";
_this.version = "5.0.3-1541966974774";
_this.debuggerWatchMap = {};

@@ -66,0 +66,0 @@ _this.debuggerComputedMap = {};

@@ -5,3 +5,3 @@ 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; }; }();

import Compute from './Compute';
import { Compute } from './Compute';

@@ -8,0 +8,0 @@ var Watch = function () {

@@ -114,3 +114,12 @@ 'use strict';

value: function onSubscription() {
var _this2 = this;
this.isDirty = true;
this.subscribers.filter(function (subscriber) {
return subscriber.watcher !== _this2;
}).forEach(function (subscriber) {
if (subscriber.watcher instanceof Compute) {
subscriber.watcher.onSubscription();
}
});
}

@@ -120,3 +129,3 @@ }, {

value: function compute() {
var _this2 = this;
var _this3 = this;

@@ -130,3 +139,3 @@ this.executedCount++;

}).map(function (computed) {
return computed.subscribe(_this2, _this2.onSubscription);
return computed.subscribe(_this3, _this3.onSubscription);
});

@@ -151,3 +160,3 @@ }

value: function parseDependencies(tag) {
var _this3 = this;
var _this4 = this;

@@ -161,7 +170,7 @@ if (!(tag instanceof _functionTree.Tag)) {

if (tag.type === 'props') {
_this3.propsTags.push(tag);
} else if (tag.type === 'state' && (0, _utils.isComputedValue)(tag.getValue(_this3.getters))) {
_this3.computedTags.push(tag);
_this4.propsTags.push(tag);
} else if (tag.type === 'state' && (0, _utils.isComputedValue)(tag.getValue(_this4.getters))) {
_this4.computedTags.push(tag);
} else {
_this3.stateTags.push(tag);
_this4.stateTags.push(tag);
}

@@ -191,3 +200,3 @@ });

value: function hasChangedProps(props) {
var _this4 = this;
var _this5 = this;

@@ -201,3 +210,3 @@ var nextGetters = this.controller.createContext(props);

return tag.getValue(_this4.getters) !== tag.getValue(nextGetters);
return tag.getValue(_this5.getters) !== tag.getValue(nextGetters);
}, false);

@@ -204,0 +213,0 @@ }

@@ -81,3 +81,3 @@ 'use strict';

_this.version = "5.0.3-1541875455582";
_this.version = "5.0.3-1541966974774";
_this.debuggerWatchMap = {};

@@ -84,0 +84,0 @@ _this.debuggerComputedMap = {};

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

var _Compute2 = _interopRequireDefault(_Compute);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -77,3 +73,3 @@

if (watcher instanceof _Compute2.default) {
if (watcher instanceof _Compute.Compute) {
this.subscribers.unshift(subscription);

@@ -80,0 +76,0 @@ } else {

{
"name": "cerebral",
"version": "5.0.3-1541875455582",
"version": "5.0.3-1541966974774",
"description": "A state controller with its own debugger",

@@ -24,3 +24,3 @@ "main": "index.js",

"es6-error": "^4.0.2",
"function-tree": "^3.3.1-1541875455582"
"function-tree": "^3.3.1-1541966974774"
},

@@ -27,0 +27,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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