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

comb

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comb - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

4

History.md

@@ -0,1 +1,5 @@

#0.1.9 / 2012-09-22
* Change comb.array.intersection to not use recursion
* added `comb.wait`
#0.1.8/2012-09-10

@@ -2,0 +6,0 @@ * Added travis CI build

@@ -760,2 +760,43 @@ var hitch = require("./base/functions").hitch,

/**
* Ensures that a promise is resolved before a the function can be run.
*
* For example suppose you have to ensure that you are connected to a database before you execute a function.
*
* ```
* var findUser = comb.wait(connect(), function findUser(id){
* //this wont execute until we are connected
* return User.findById(id);
* });
*
* comb.when(findUser(1), findUser(2)).then(function(users){
* var user1 = users[0], user2 = users[1];
* });
*
* ```
*
* @param args variable number of arguments to wait on. See {@link comb.when}.
* @param {Function} fn function that will wait.
* @return {Function} a function that will wait on the args to resolve.
* @memberOf comb
* @static
*/
function wait(args, fn) {
var args = argsToArray(arguments), resolved = false;
fn = args.pop();
var p = when(args);
return function waiter() {
if (!resolved) {
args = arguments;
return p.chain(function doneWaiting() {
resolved = true;
return fn.apply(this, args);
}.bind(this));
} else {
return when(fn.apply(this, arguments));
}
}
}
base.merge(exports, {

@@ -765,2 +806,3 @@ isPromiseLike:isPromiseLike,

wrap:wrap,
wait:wait,
serial:serial,

@@ -767,0 +809,0 @@ chain:chain,

10

package.json
{
"name":"comb",
"description":"A framework for node",
"version":"0.1.8",
"version":"0.1.9",
"keywords":["OO", "Object Oriented", "Collections", "Tree", "HashTable", "Pool", "Logging", "Promise", "Promises", "Proxy"],

@@ -16,7 +16,7 @@ "repository":{

},
"devDependencies" : {
"it": "0.0.5"
"devDependencies":{
"it":"0.0.5"
},
"scripts": {
"test": "make test-travis"
"scripts":{
"test":"make test-travis"
},

@@ -23,0 +23,0 @@ "engines":{

Sorry, the diff of this file is not supported yet

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