An open API service indexing awesome lists of open source software.

https://github.com/dimfeld/pull-promise-map-done

Pull stream for promise-returning asynchronous map functions
https://github.com/dimfeld/pull-promise-map-done

Last synced: over 1 year ago
JSON representation

Pull stream for promise-returning asynchronous map functions

Awesome Lists containing this project

README

          

# pull-promise-map-done

This is based on the async-map through stream from the core pull-stream module, but it is designed to work with promise-returning functions and also incorporates a done callback. Either the map or the done callbacks may be omitted.

```
var asyncMap = require('pull-promise-map-done');

asyncMap(
function map(data) {
return promiseReturningFunction(data);
},
function done(err) {
if(err) {
return promiseReturningErrorReporter(err);
}
}
)
```