Static
[species]Waits for timer, then executes callback with the futurable value and returns the result obtained from the invocation.
callback executed after timer with futurable chain value as parameter
timer to wait (in milliseconds)
Extension of the fetch API with cancellation support. Url parameter can be a string or a function with receive value from futurable chaining as paremeter.
url to fetch or function with futurable chaining value that returns url to fetch
Optional
opts: object | RequestInit | ((val?) => RequestInit)fetch options or function with futurable chaining value that return fetch options
Attaches a callback that is invoked when the Futurable is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.
Takes a promise and transforms it into a futurizable. Promise can be also a function that receives value from futurable chaining as parameter.
Attaches callbacks for the resolution and/or rejection of the Futurable.
Optional
onfulfilled: null | ((value) => TResult1 | PromiseLike<TResult1> | FuturableLike<TResult1>)Optional
onrejected: null | ((reason) => TResult2 | PromiseLike<TResult2> | FuturableLike<TResult2>)Static
allCreates a Futurable with cancellation support that is resolved with an array of results when all of the provided Futurables resolve, or rejected when any Futurable is rejected.
Optional
signal: AbortSignalStatic
allCreates a Futurable with cancellation support that is resolved with an array of results when all of the provided Futurables resolve or reject.
Optional
signal: AbortSignalStatic
anyThe any function returns a futurable with cancellation support that is fulfilled by the first given futurable to be fulfilled, or rejected with an AggregateError containing an array of rejection reasons if all of the given futurables are rejected. It resolves all elements of the passed iterable to futurables as it runs this algorithm.
Optional
signal: AbortSignalStatic
delayStatic
fetchStatic
futurizableStatic
onStatic
pollingCreates a polling service with cancellation support and possibility to handle error. An optional param immediate can be set true if fun must to be invoke immediatly.
Static
raceStatic
rejectStatic
resolveStatic
sleepStatic
withExtension of Promise.withResolvers static method. Creates a new Futurable and returns it in an object, along with its resolve, reject and cancel functions and utils object.
Optional
signal: AbortSignal
Return internal futurable signal