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

reactive-function

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reactive-function - npm Package Compare versions

Comparing version 0.13.0 to 0.13.1

4

index.js

@@ -47,2 +47,6 @@ var ReactiveProperty = require("reactive-property");

var output = options.output;
if(!defined(inputs)){
throw new Error("Attempting to use an undefined property as a reactive function input.");
}

@@ -49,0 +53,0 @@ if(!output){

2

package.json
{
"name": "reactive-function",
"version": "0.13.0",
"version": "0.13.1",
"description": "A library for managing data flows and changing state.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -464,2 +464,47 @@ // Unit tests for reactive-function.

it("Should execute a doubly nested digest.", function (){
var a = ReactiveProperty(5);
var b = ReactiveProperty();
var c = ReactiveProperty();
var d = ReactiveProperty();
var e = ReactiveProperty();
var rf1 = ReactiveFunction({
inputs: [a],
callback: function (a){
for(var i = 0; i < a; i++){
b(i);
ReactiveFunction.digest();
assert.equal(c(), i / 2);
}
}
});
var rf2 = ReactiveFunction({
inputs: [b],
output: c,
callback: function (b){
d(b);
ReactiveFunction.digest();
return e();
}
});
var rf3 = ReactiveFunction({
inputs: [d],
output: e,
callback: function (d){
return d / 2;
}
});
ReactiveFunction.digest();
rf1.destroy();
rf2.destroy();
rf3.destroy();
});
});

@@ -571,3 +616,3 @@

// Fix by changing the value of initialId.
var initialId = 60;
var initialId = 66;

@@ -692,2 +737,19 @@ it("Should serialize the data flow graph.", function (){

});
describe("Edge Cases and Error Handling", function (){
it("Should throw error when input property is not defined.", function(){
var b = ReactiveProperty();
assert.throws(function (){
var rf = ReactiveFunction({
inputs: [undefined],
output: b,
callback: function (a){
return a * 2;
}
});
}, /Attempting to use an undefined property as a reactive function input/);
});
});
});
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