@pond-ts/process API Reference
    Preparing search index...

    Function derive

    • Builds a single-output node and wires it to its sources in one step — the shape most graph edges take.

      const smoothed = derive({ series: raw.out.value }, ({ series }) =>
      series.smooth('cpu', { method: 'ema', alpha: 0.3 }),
      );
      smoothed.out.value.get();

      Equivalent to defineNode with one output named value, an input per source key, and the connections already made. Reach for defineNode when a node has several outputs, or when the node type is reused across graphs and deserves a name.

      Type Parameters

      • Sources extends Readonly<Record<string, Outlet<any>>>
      • R

      Parameters

      • sources: Sources
      • compute: (inputs: { [K in string | number | symbol]: OutletValue<Sources[K]> }) => R
      • options: { equals?: (a: R, b: R) => boolean; kind?: string } = {}
        • Optional Readonlyequals?: (a: R, b: R) => boolean

          Change test for the output. Defaults to Object.is.

        • Optional Readonlykind?: string

          Node type name for errors and toJSON(). Defaults to 'derive'.

      Returns Node<SpecsForOutlets<Sources>, DerivedOutput<R>>