The value type.
The initial value.
Transform functions (may be nested arrays).
The final transformed value.
const result = await applyAsyncTransforms(
{ id: 1 },
async (o) => ({ ...o, data: await fetchData(o.id) }),
);
applyTransforms for the sync version.
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.