First parameter of funcs should be value (props[prop])
mikestopcontinues opened this issue · comments
Mike Stop Continues commented
Hi! I realize this is a breaking change, but I believe it's worth it. See the following:
Before:
by('size', (props) => pxToRem(props['size']))
by('colorName', (props) => namesToHex[props['colorName']])
After:
by('size', pxToRem)
by('colorName', (name) => namesToHex[name])
I suggest the signature (value, props)
. This would allow you to compose chains of functions (a la R.pipe
or _.flow
), and it would also allow you to reuse logic across components. (For instance, that pxToRem
function.
Bruno Bertolini commented
Hi Mike, sorry for the delay, I was very busy in the last few months.
I like this strategy, and will appreciate a PR, because, well, I will continue busy in the nexts few months 😄
Mike Stop Continues commented
Swell! I'll send one along soon.