Skip to main content

type Chain<RS,A,RRS>

Represents a chain of Tasks with typed results and arguments. Each Task in the chain receives the result of the previous as its argument.

Definition

type Chain<RS extends any[], A extends any[], RRS extends any[] = {
    [K in keyof RS]: [RS[K]];
  }> = [Task<unknown, A>, ...unknown[]] & {
    [K in keyof RS]: Task<RS[K], Prepend<A, RRS>[K & keyof Prepend<A, RRS>]>;
  };