1.0.2 • Published 7 years ago

kisspromise v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

KISS PROMISE

Motivation

This is a very simple, lightweight implementation of advanced promise features that extend built in promises

Features

  • Everything from Built in Promises
  • Static Methods:
    • Promise.map(array, callback) - Maps an array and returns it as a promise
    • Promise.each(array, callback) - Same as map but with only one parameter to the callback.
  • Member Methods:
    • map(callback) - Runs .then with the same callback function on each promise in the array of Promises. Eg: Promise.all(...).map
    • each(callback) - Same as .map, but with only one parameter passed. Useful for printing the result of each. Promise.all(...).each(console.log)
    • parallel(...callbacks) - Runs callbacks in parallel. Results are in an array similar to Promise.all
    • filter(callback) - Filters promises by callback