How to use the native-promise-only/npo.resolve function in native-promise-only

To help you get started, we’ve selected a few native-promise-only examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TehShrike / abstract-state-router / lib / promise-map-series.js View on Github external
module.exports = function sequence(array, iterator, thisArg) {
	var current = Promise.resolve()
	var cb = arguments.length > 2 ? iterator.bind(thisArg) : iterator

	var results = array.map(function(value, i) {
		return current = current.then(function(j) {
			return cb(value, j, array)
		}.bind(null, i))
	})

	return Promise.all(results)
}

native-promise-only

Native Promise Only: A polyfill for native ES6 Promises **only**, nothing else.

MIT
Latest version published 9 years ago

Package Health Score

55 / 100
Full package analysis