motion
Version:
motion - moving development forward
14 lines (11 loc) • 712 B
JavaScript
exports.__esModule = true;
var _libHelpers = require('../lib/helpers');
exports['default'] = {
enter: function enter(node, parent, scope) {
if (node.name.name == 'sync') {
return [_libHelpers.t.JSXAttribute(_libHelpers.t.literal('__motionValue'), node.value), _libHelpers.t.JSXAttribute(_libHelpers.t.literal('__motionOnChange'), _libHelpers.t.functionExpression(null, [_libHelpers.t.identifier('__motionval__')], _libHelpers.t.blockStatement([_libHelpers.t.expressionStatement(_libHelpers.t.assignmentExpression('=', node.value, _libHelpers.t.identifier('__motionval__')))])))];
}
node.name.name = _libHelpers.niceJSXAttributes(node.name.name);
}
};
module.exports = exports['default'];