deconstruct-js

Home > deconstruct-js > transform

transform() function

Creates a new Deconstructor that transforms the value returned by the previous one

Signature:

declare function transform<T, U>(inner: Deconstructor<T>, transformFn: (deconstruction: Deconstruction<T>) => U): Deconstructor<U>;

Parameters

Parameter Type Description
inner Deconstructor<T>  
transformFn (deconstruction: Deconstruction<T>) => U  

Returns:

Deconstructor<U>

Remarks

If you’re employing this with the same function a lot, it might be worth it for you (performance-wise) to implement it as a true Deconstructor