🗡️
ConanJs
  • What is ConanJs?
  • Why ConanJs...
    • ... if coming from Redux
    • ... if using vanilla React
    • ... if learning React
    • ... if not using React
  • How to install/use ConanJs
  • About us / Github / Contact us
  • Demos
    • Demo Gallery
    • Conan State Demos
      • Hello World
      • Todos
        • Todos - Basic
        • Todos - Async
        • Todos - Optimistic
      • Github issues viewer
    • Conan Flow Demos
      • Authentication
  • CONAN DATA
    • General Concepts
    • Conan State
      • Actions & Reducers
        • Reducers
        • Actions
      • Creating State
      • Observing State
        • Live rendering
        • Connecting
      • Composing State
      • Scaling State
      • Orchestrating State
      • Life cycle
        • Async handling
        • Introspection
      • Testing state
    • Conan Flow
      • Creating Flows
      • Serialising Flows
      • Observing Flows
  • CONAN Runtime
  • Dependency Injection
    • General Concepts
    • Creating the Context
    • Using the Context
  • ASAPs
  • Logging
  • API
    • Main Classes
      • Conan
        • StateDef
      • ConanState
      • ConanFlow
        • UserFlowDef
        • UserStatusDef
        • Status
    • Conan State Classes
      • Thread
      • ConnectedState
      • MonitorInfo
      • MetaInfo
    • Dependency Injection
      • DiContextFactory
    • ASAPS
      • Asaps
      • Asap
Powered by GitBook
On this page
  • catch
  • then
  • chain<Z>
  • map<Z>
  • map<Z>
  • cancel

Was this helpful?

  1. API
  2. ASAPS

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

​

PreviousAsaps

Last updated 4 years ago

Was this helpful?