@jiminp/tooltool
    Preparing search index...

    Function applyAsyncTransforms

    • Applies a sequence of async (or sync) transform functions to a value.

      Each function is awaited in order. Functions can return a new value (pure) or mutate in-place and return undefined. Nested arrays are flattened.

      Type Parameters

      • T

        The value type.

      Parameters

      Returns Promise<T>

      The final transformed value.

      const result = await applyAsyncTransforms(
      { id: 1 },
      async (o) => ({ ...o, data: await fetchData(o.id) }),
      );

      applyTransforms for the sync version.