Skip to content

Instantly share code, notes, and snippets.

@sdawood
Created July 20, 2018 04:12
Show Gist options
  • Select an option

  • Save sdawood/8eb888ae92b54193b4ac21d53dd891a7 to your computer and use it in GitHub Desktop.

Select an option

Save sdawood/8eb888ae92b54193b4ac21d53dd891a7 to your computer and use it in GitHub Desktop.
Reducing the Async Generator into an Array
const F = require('functional-pipelines')
async function queryAll(table, {keyConditionExpression, expressionAttributeValues, strict, limit} = {}, options = {}, params = {}) {
return F.reduceAsync(F.append(/*reducingFn*/), () => [], querySequence(table, {keyConditionExpression, expressionAttributeValues, limit, strict}, options, params));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment