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

alamid-junction

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alamid-junction - npm Package Compare versions

Comparing version 0.9.1 to 0.9.2

7

lib/Junction.js

@@ -67,7 +67,7 @@ "use strict";

if (obj.hasOwnProperty(key)) {
setter(this, key, this.setter(key, obj[key]));
setter(this, key, obj[key]);
}
}
} else {
setter(this, key, this.setter(key, value));
setter(this, key, value);
}

@@ -224,5 +224,6 @@

if (signal) {
// the signal will apply the junction's setter as well
signal(value);
} else {
junction._values[key] = value;
junction._values[key] = junction.setter(key, value);
}

@@ -229,0 +230,0 @@ }

{
"name": "alamid-junction",
"version": "0.9.1",
"version": "0.9.2",
"description": "Provides convenient methods for setting and retrieving multiple signals",

@@ -5,0 +5,0 @@ "main": "./lib/Junction.js",

@@ -45,11 +45,9 @@ "use strict";

describe(".prototype", function () {
var givenValue;
function Signal() {
var listener,
givenValue;
var listener;
function signal(value) {
if (arguments.length === 1) {
if (signal.setter) {
value = signal.setter(value);
}
givenValue = value;

@@ -242,2 +240,9 @@ listener && listener(value);

it("should only by called once when there is also a signal", function () {
junction.signal("name");
junction.set("name", "Mighty pirate");
expect(junction.setter).to.have.been.calledOnce;
});
});

@@ -262,7 +267,5 @@

expect(greeting()).to.equal("Ahoy!");
expect(age()).to.equal(34);
expect(greeting()).to.equal(34);
junction.reset();
expect(greeting()).to.equal(undefined);
expect(age()).to.equal(undefined);
});

@@ -336,14 +339,6 @@

it("should return a signal representing the value specified by key", function () {
var greeting,
name;
var greeting = junction.signal("greeting");
junction.set("name", "The mighty pirate");
name = junction.signal("name");
greeting = junction.signal("greeting");
expect(greeting()).to.equal(undefined);
expect(name()).to.equal("The mighty pirate");
junction.set("greeting", "Ahoy!");
expect(greeting()).to.equal("Ahoy!");

@@ -350,0 +345,0 @@ expect(junction.get("greeting")).to.equal("Ahoy!");

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