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

perform

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

perform

A sensible deferred library

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

perform

A sensible deferred library

A current work in progress, so don't use this yet


// for the sake of example, a simple log funtion
var log = function( x ) { console.log( x ); };

// so you have a deffered just like normal
var dfdA = perform.er();
dfdA.done( log, 'Yay! The deferred resolved!' );
dfdA.fail( log, 'Uh oh, it failed :(' );

// and this one
var dfdB = perform.er();
dfdB.done( log, 'B is so cool!' );
dfdB.fail( log, 'whatever....' );

// and now the reveal
perform( log, 'All done bitches' )
  .when( dfdA )
  .unless( dfdB );

dfdA.resolve();
dfdB.reject();

// CONSOLE:
// => Yay! The deferred resolved!
// => whatever...
// => All done bitches

As for arguments, you can still do a function like normal:

var dfdA = perform.er();
dfdA.done( function( arg1 ) {
  console.log( arg1 );
});
dfdA.resolve( 'hi there' );

// CONSOLE:
// => hi there

Or specify stuff inline like this:


var doSomething = function( x, y ) {
  console.log( x * y );
};
var dfdA = perform.er();
dfdA.done( doSomething, 5, perform.arg(0) );
dfdA.resolve( 20 );

// CONSOLE:
// => 100

Getting Started

Install the module with: npm install perform

Documentation

(Coming soon)

Examples

(Coming soon)

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

(Nothing yet)

License

Copyright (c) 2012 Dan Heberden
Licensed under the MIT license.

FAQs

Package last updated on 23 Oct 2012

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