New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

autoflow-deferred

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autoflow-deferred

autoflow-deferred is a plugin for autoflow, the flow control rules engine, which adds integration with jQuery-style Deferred promises

  • 0.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

autoflow-deferred

Build Status

autoflow-deferred is a plugin for autoflow, the flow control rules engine, which adds integration with jQuery-style Deferred promises

For more information on autoflow the lightweight flow control rules engine: http://github.com/jeffbski/autoflow

Goals

  • make it easy to use React defined functions, promise style and in this case with promises that are compatible with jQuery
  • if a autoflow defined flow function is called without a callback, then a Deferred promise is returned
  • if promises are passed in as input parameters, they will automatically be resolved before tasks are called

Installing

npm install autoflow-deferred

OR

Pull from github - http://github.com/jeffbski/autoflow-deferred

Example

var autoflow = require('autoflow-deferred'); // enable deferred promise integration, return autoflow
// autoflow.logEvents(); // to enable logging to stderr of flow and task events

function loadData(x, y, cb) {
  setTimeout(function () {
    cb(null, x * y);
  }, 10);
}

function loadUser(uid, cb) {
  setTimeout(function () {
    cb(null, uid + '_user');
  }, 10);
}

function render(user, data) {
  return user + data;
}


var fn = autoflow('myflow', 'a, b, uid, cb -> err, renderedOut',
  loadData, 'a, b, cb -> err, c',
  loadUser, 'uid, cb -> err, user',
  render, 'user, c -> renderedOut'
);


var promise = fn(2, 3, 'joe');  // calling without passing in cb
promise.then(function (renderedOut) {
  console.error('renderedOut:', renderedOut);
});

License

Contributors

  • Author: Jeff Barczewski (@jeffbski)

Contributing

Keywords

FAQs

Package last updated on 14 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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