This is a simple batch processing gateway that returns a promise, simple solver of complex promise batch problems.
const gateway = require('sf-promise-gateway');
const items = [ "a", "b", "c"];
gateway(items, (item, next) => {
const onSuccess = (result) => {
next(null, result);
};
const onError = (error) => {
next(error);
};
somethingAsync(onSuccess, onError);
})
.then((results) => {
});