Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Flow + functional programming = 💩
// Well, shit
const verticalModifiers = ['top', 'middle', 'bottom'];
const horizontalModifiers = ['start', 'center', 'end'];
const modifiers = verticalModifiers.concat(horizontalModifiers);
const getPassthroughClassNames = () => modifiers
.map(name => [name, props[name]])
.filter(([, value]) => value)
.map(([name, value]) => `${name}-${value}`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment