Skip to content

Instantly share code, notes, and snippets.

@syzer
Created April 8, 2015 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syzer/274701f952f1452eb0ee to your computer and use it in GitHub Desktop.
Save syzer/274701f952f1452eb0ee to your computer and use it in GitHub Desktop.
mergeBigSample
var dataBase; // cache
function mergeBig(texts) {
texts = texts || text;
return q.all(texts.map(function (el) {
return task(el)
.reduce(bigramArray)
.run()
})).then(function reducer(data) {
//return task(data).add('merge').run();
return _.mergeObjectsInArr(data);
}).then(function cacheInDb(data) {
dataBase = data;
return data;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment