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
- Host: GitHub
- URL: https://github.com/dimfeld/pull-promise-map-done
- Owner: dimfeld
- License: mit
- Created: 2018-06-21T23:32:40.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-05T18:43:23.000Z (about 8 years ago)
- Last Synced: 2025-03-18T12:34:04.777Z (over 1 year ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
}
}
)
```