Asap
This interface defines the helper methods around a Conan Asap
export interface Asap<T> {
catch(error: IConsumer<Error>): this;
‚Äč
then(consumer: IConsumer<T>): this;
‚Äč
onCancel(consumer: ICallback): this;
‚Äč
map<Z>(mapper: IFunction<T, Z>): Asap<Z>;
‚Äč
chain<Z>(chainProducer: IFunction<T, Asap<Z>>): Asap<Z>;
‚Äč
type: AsapType;
‚Äč
cancel(): boolean;
}

catch

it will be invoked when an error is thrown while resolving the Asap's Promise
Input
‚Äč
error
Type: IConsumer<Error>required
the function to invoke
Returns
‚Äč
this
‚Äč
‚Äč

then

‚ÄĆit will be invoked when the Asap's Promise is resolved
Input
‚ÄčTitle
consumer
Type: IConsumer<T>required
the function to invoke
Returns
‚ÄčTitle
this
‚Äč
‚Äč

chain<Z>

‚ÄĆallows chaning Asaps
Input
‚ÄčTitle
chainProducer
Type: IFunction<T, Asap<Z>>required
the function to invoke
Returns
‚ÄčTitle
this
‚Äč
‚Äč

map<Z>

‚ÄĆmaps an Asap into a another one
Input
‚ÄčTitle
mapper
Type: IFunction<T, Z>required
the function to invoke
Returns
‚ÄčTitle
Asap<Z>
‚Äčthe re-mapped Asap
‚Äč

map<Z>

‚ÄĆmaps an Asap into a another one
Input
‚ÄčTitle
mapper
Type: IFunction<T, Z>required
the function producing the new chained Asap
Returns
‚ÄčTitle
Asap<Z>
‚Äčthe chained Asap
‚Äč

cancel

‚ÄĆcancels an Asap
Returns
‚ÄčTitle
‚Äč
void
‚Äč
Last modified 2yr ago
Copy link
On this page
catch
then
chain<Z>
map<Z>
map<Z>
cancel