Create sequence of plain object's enhancers, powered with extraflow.
Modifications:
- Auto spread objects;
- Type restricted.
const enhancer = propsflow(
() => ({ A, B, C }) => ({
D: A + B + C,
}),
({ A }) => ({
B: A * 2,
}),
({ B }) => ({
C: B * 2
}),
)
enhancer({
A: 2
});
/*
{
A: 2,
B: 4,
C: 8,
D: 14
}
*/
MIT, 2018, Vladimir Morulus vladimirmorulus@gmail.com