D - Commands

SDK command are async operations that provide

  • Parallel actions

  • Double execution protection

  • Reactive, realtime, stage and status info

Execute

await <command>.execute(id: string, <params>)

// returns
the result type of the specific command

Is Running

<command>.isRunning(id?: string).value

State

<command>.state(id: string)

//returns
{
    status: signal<string>,
    stage: signal<string>,
    results: signal<object>   
}

Custom Prep Func

When calling execute, it is possible to prove an async function that returns params instead of params directly. In this case, the command function will add a 'preparation' stage that will run the function before calling the build-in actions.

<command>.execute(id: string, async () => { ... return <params> })

Last updated