Socket
Socket
Sign inDemoInstall

ampersand-state

Package Overview
Dependencies
20
Maintainers
7
Versions
65
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0 to 5.0.1

26

ampersand-state.js

@@ -30,2 +30,3 @@ 'use strict';

this._values = {};
this._eventBubblingHandlerCache = {};
this._definition = Object.create(this._definition);

@@ -501,3 +502,3 @@ if (options.parse) attrs = this.parse(attrs, options);

this._safeSet(child, new this._children[child]({}, {parent: this}));
this.listenTo(this[child], 'all', this._getEventBubblingHandler(child));
this.listenTo(this[child], 'all', this._getCachedEventBubblingHandler(child));
}

@@ -508,10 +509,13 @@ },

// adding a name to the change string.
_getEventBubblingHandler: function (propertyName) {
return bind(function (name, model, newValue) {
if (changeRE.test(name)) {
this.trigger('change:' + propertyName + '.' + name.split(':')[1], model, newValue);
} else if (name === 'change') {
this.trigger('change', this);
}
}, this);
_getCachedEventBubblingHandler: function (propertyName) {
if (!this._eventBubblingHandlerCache[propertyName]) {
this._eventBubblingHandlerCache[propertyName] = bind(function (name, model, newValue) {
if (changeRE.test(name)) {
this.trigger('change:' + propertyName + '.' + name.split(':')[1], model, newValue);
} else if (name === 'change') {
this.trigger('change', this);
}
}, this);
}
return this._eventBubblingHandlerCache[propertyName];
},

@@ -762,7 +766,7 @@

if (previousVal) {
this.stopListening(previousVal);
this.stopListening(previousVal, 'all', this._getCachedEventBubblingHandler(attributeName));
}
if (newVal != null) {
this.listenTo(newVal, 'all', this._getEventBubblingHandler(attributeName));
this.listenTo(newVal, 'all', this._getCachedEventBubblingHandler(attributeName));
}

@@ -769,0 +773,0 @@ }

{
"name": "ampersand-state",
"description": "An observable, extensible state object with derived watchable properties.",
"version": "5.0.0",
"version": "5.0.1",
"author": "Henrik Joreteg <henrik@andyet.net>",

@@ -6,0 +6,0 @@ "files": [

@@ -542,3 +542,3 @@ # ampersand-state

var Person = AmpersandState.extend({
var Person = State.extend({
props: {

@@ -545,0 +545,0 @@ name: 'string'

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc