Asaps
This class has a set of helper methods to handle Asaps:
now<T>
this method resolves a passed value as an Asap synchronously
Input | |
value | Type: the callback to invoke |
Returns | |
Asap<T> |
fromPromise<T>
this method creates an Asap from a Promise
Input | |
promise | Type: the Promise to create the Asap from |
name | Type: name use mainly for logging purposes |
Returns | |
Asap<T> |
delay
this method creates a delayed asynchronous Asap from a the value and timeout provided
Input | Title |
value | Type: the value to create the Asap from |
ms | Type: the delay in milliseconds |
name | Type: name use mainly for logging purposes |
Returns | Title |
Asap<T> | Content |
fetch<T>
this method performs a fetch from the given url, and it wraps it up in an Asap
Input | Title |
url | Type: the url to fetch |
Returns | Title |
Asap<T> | Content |
next<T>
this method lets you create a promise that will be resolved synchronously
Input | Title |
name | Type: name use mainly for logging purposes |
nature | Type: custom log nature |
Returns | Title |
[IConsumer<T>, Asap<T>] | The Asap returned can be resolved |
Last updated