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

ampersand-state

Package Overview
Dependencies
Maintainers
4
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-state - npm Package Compare versions

Comparing version 4.3.10 to 4.3.11

5

ampersand-state.js

@@ -663,3 +663,6 @@ var _ = require('underscore');

if (!isSame) {
this.stopListening(currentVal);
if (currentVal) {
this.stopListening(currentVal);
}
if (newVal != null) {

@@ -666,0 +669,0 @@ this.listenTo(newVal, 'all', this._getEventBubblingHandler(attributeName));

2

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

@@ -6,0 +6,0 @@ "bugs": {

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

To create a **State** class of your own, you extend **AmpersandState** and provide instance properties and options for your class. Typically here you will pass any properties (`props`, `session` and `derived` of your state class, and any instance methods to be attached to instances of your class.
To create a **State** class of your own, you extend **AmpersandState** and provide instance properties and options for your class. Typically here you will pass any properties (`props`, `session` and `derived`) of your state class, and any instance methods to be attached to instances of your class.

@@ -33,0 +33,0 @@ **extend** correctly sets up the prototype chain, so that subclasses created with **extend** can be further extended as many times as you like.

@@ -1046,3 +1046,4 @@ var tape = require('tape');

props: {
sub: 'state'
sub: 'state',
sub2: 'state'
}

@@ -1104,2 +1105,35 @@ });

test.only('Issue: #75 `state` property from undefined -> state', function (t) {
t.plan(2);
var Person = State.extend({
props: {
sub: 'state',
sub2: 'state'
}
});
var SubState = State.extend({
props: {
foo: 'string'
}
});
var sub = new SubState({ foo: 'a' });
var p = new Person({ sub: sub });
p.on('change:sub.foo', function () {
t.ok(true);
});
sub.foo = 'b';
p.sub2 = new SubState({ foo: 'bar' });
sub.foo = 'c';
t.end();
});
test('`state` properties should invalidate dependent derived properties when changed', function (t) {

@@ -1106,0 +1140,0 @@ var counter = 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