INNER CODE UNIT · JavaScript
makeBreakpointCallExpression
grapp-dev/stacks · plugin/index.js:10
const makeBreakpointCallExpression = (key, value) => {
const expression = value.type === 'JSXExpressionContainer' ? value.expression : value;
return t.callExpression(
t.memberExpression(
t.callExpression(t.identifier('useBreakpointComparators'), []),
t.identifier(key),
),
[expression],
);
};
const transformAttributeFactory = attributes => {
return (attributeName, expressionName) => {
const attribute = getAttribute(attributes, attributeName);
if (attribute) {
return makeBreakpointCallExpression(expressionName, attribute.value);