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

reflow

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reflow - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

9

index.js

@@ -36,7 +36,8 @@ var async = require("async");

//Run any trigger functions now state is set
async.each(transition.triggers||[], function(t, cb){
return t(obj, cb);
}, function(err) {
return callback(err, obj);
(transition.triggers||[]).forEach(function(t) {
process.nextTick(function() {
return t(obj);
});
});
return callback(null, obj);
});

@@ -43,0 +44,0 @@

{
"name": "reflow",
"version": "0.0.6",
"version": "0.0.7",
"description": "Simple to use workflow/transitions helper.",

@@ -5,0 +5,0 @@ "keywords" : ["workflow", "workflows"],

@@ -9,2 +9,15 @@ var assert = require('assert');

function waitFor(attr, value, callback) {
function wait() {
if(!testBucket.hasOwnProperty(attr)) {
setTimeout(wait, 200);
} else {
assert.equal(testBucket[attr], value);
callback(null);
}
}
wait();
}
var workflow = {

@@ -41,10 +54,8 @@ one : {

function oneToTwoTrigger1(obj, cb) {
function oneToTwoTrigger1(obj) {
testBucket.oneToTwoTrigger1 = true;
cb(null);
}
function oneToTwoTrigger2(obj, cb) {
function oneToTwoTrigger2(obj) {
testBucket.oneToTwoTrigger2 = true;
cb(null);
}

@@ -57,5 +68,4 @@

function failTrigger(obj, cb) {
function failTrigger(obj) {
testBucket.failTrigger = true;
cb({badThings:'happened'});
}

@@ -87,6 +97,8 @@

assert.equal(testBucket.oneToTwoCond2, true);
assert.equal(testBucket.oneToTwoTrigger1, true);
assert.equal(testBucket.oneToTwoTrigger2, true);
assert.equal(obj.state, 'two');
done();
waitFor('oneToTwoTrigger1', true, function() {
waitFor('oneToTwoTrigger2', true, function() {
assert.equal(obj.state, 'two');
done();
});
});
});

@@ -97,3 +109,2 @@ });

transition(obj, 'three', function(err){
assert.equal(testBucket.failTrigger, true);
assert.equal(obj.state, 'three');

@@ -100,0 +111,0 @@ done();

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