Skip to content

Commit

Permalink
Fix an example
Browse files Browse the repository at this point in the history
  • Loading branch information
hilja committed Dec 10, 2019
1 parent 39d1a56 commit 0b15b5d
Showing 1 changed file with 5 additions and 29 deletions.
34 changes: 5 additions & 29 deletions examples/batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,11 @@ const batch = require('../src/batch')

const files = 'fixtures/test-content/**'

// const results = batch(files, 1, async ({ goods, index, delay }) => {
// // await delay(1000)
// console.log(goods.data.title)

// return goods

// // return goods.data.title + ' ' + index
// })

// const testFunc = async () => {
// const results = await batch(files, 1, async ({ goods, index, delay }) => {
// return goods
// })

// console.log(results)
// }

// testFunc()

;(async () => {
const foo = await batch(files)
const postTitles = await batch(files, 1, async ({ goods, index, delay }) => {
// Do stuff to the data coming from the files.
return index + ': ' + goods.data.title
})

console.log(foo)
console.log(postTitles)
})()

// console.log(results)

// results
// .then(data => {
// console.log(data)
// })
// .catch(error => console.error(error))

0 comments on commit 0b15b5d

Please sign in to comment.