Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka Skukan committed Nov 17, 2016
1 parent af08312 commit 4352359
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions collection_each_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ function filter(apps, cb) {
l.reset();
var i = 0;
function iterator(app, cb) {
cb(i++ % 2 === 0);
cb(null, i++ % 2 === 0);
}

async.series([
function (cb) {
apps.filter(l.i(iterator), l.c(cb, 1));
apps.filter(l.i(iterator), l.c(cb));
},
function (cb) {
apps.filterSeries(l.i(iterator), l.c(cb, 1));
apps.filterSeries(l.i(iterator), l.c(cb));
}
], cb);
}
Expand All @@ -163,15 +163,15 @@ function reject(apps, cb) {
l.reset();
var i = 0;
function iterator(app, cb) {
cb(i++ % 2 === 0);
cb(null, i++ % 2 === 0);
}

async.series([
function (cb) {
apps.reject(l.i(iterator), l.c(cb, 1));
apps.reject(l.i(iterator), l.c(cb));
},
function (cb) {
apps.rejectSeries(l.i(iterator), l.c(cb, 1));
apps.rejectSeries(l.i(iterator), l.c(cb));
}
], cb);
}
Expand All @@ -197,15 +197,15 @@ function detect(apps, cb) {
l.reset();
var i = 0;
function iterator(app, cb) {
cb(0 === i++ % 2);
cb(null, 0 === i++ % 2);
}

async.series([
function (cb) {
apps.detect(l.i(iterator), l.c(cb, 1));
apps.detect(l.i(iterator), l.c(cb));
},
function (cb) {
apps.detectSeries(l.i(iterator), l.c(cb, 1));
apps.detectSeries(l.i(iterator), l.c(cb));
}
], cb);
}
Expand All @@ -214,20 +214,20 @@ function some(apps, cb) {
l.reset();
var i = 0;
function iterator(app, cb) {
cb(0 === i++ % 2);
cb(null, 0 === i++ % 2);
}

apps.some(l.i(iterator), l.c(cb, 1));
apps.some(l.i(iterator), l.c(cb));
}

function every(apps, cb) {
l.reset();
var i = 0;
function iterator(app, cb) {
cb(0 === i++ % 2);
cb(null, 0 === i++ % 2);
}

apps.every(l.i(iterator), l.c(cb, 1));
apps.every(l.i(iterator), l.c(cb));
}

function sortBy(apps, cb) {
Expand All @@ -251,4 +251,4 @@ function concat(apps, cb) {
apps.concatSeries(l.i(iterator), l.c(cb));
}
], cb);
}
}

0 comments on commit 4352359

Please # to comment.