dimfeld / pull-promise-map-done

Pull stream for promise-returning asynchronous map functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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);
        }
    }
)

About

Pull stream for promise-returning asynchronous map functions

License:MIT License


Languages

Language:JavaScript 100.0%