p-prom
Inherits native Promise
to create a new type. This type has the following differences/enhancements:
Spreadable.reject
make sure the reason is an ErrorSpreadable.node
converts a node-style callback function into a promise returning oneSpreadable.all
accepts its parts as an array or arguments. (i.e. it flattens)Spreadable.seq
accepts a list of function that are each sequenced using.then
Spreadbale.node(function)
converts/promisifies a node-style function to a promise creating versionSpreadable.defer
creates a deferred with these properties:resolve
resolves the deferredreject
rejects the deferredpromise
is the promise of the deferred
spreadable.spread(handler)
calls the resolve handler with the solve value spread as arguments.spreadable.finally(handler)
is a callshandler(reason, value)
whether resolved or rejected