Home > deconstruct-js > transform
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>;
Parameter | Type | Description |
---|---|---|
inner | Deconstructor<T> |
|
transformFn | (deconstruction: Deconstruction<T>) => U |
Returns:
Deconstructor<U>
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