The Oath constructor. It takes a single function
argument executor
. Returns a new Oath when
invoked with the new
keyword.
The defining function for an Oath. It is passed two callbacks when invoked by the Oath constructor:
resolve
, if/when invoked, will resolve the Oath
with the value passed to it. If resolutionValue
is
also an Oath, the resolution or rejection of
resolutionValue
will cascade to the Oath being created.
reject
, if/when invoked, will reject the Oath with
the value passed to it. This should be used only with
instances of Error
or one of its subclasses (e.g.,
RangeError
).
Standard then
method for those familiar with promises.
Returns a new Oath chained to oath
.
Standard catch
method for those familiar with promises.
Returns a new Oath chained to oath
.
Creates a new Oath that resolves only once all Oaths in
oathArray
have resolved. It rejects if one or more Oaths
in the passed-in array reject.
Returns a new Oath chained to all Oaths in oathArray
.
Creates a new Oath that resolves if one or more Oaths in
oathArray
resolves. It rejects only if all Oaths in
the passed-in array reject.
Returns a new Oath chained to all Oaths in oathArray
.