UNPKG

@dunite/au-react-wrapper

Version:
16 lines (13 loc) 554 B
import { bindable, bindingMode } from "aurelia-framework"; import { camelToKebab } from "./camelToKebab"; export function addPropertiesState(aureliaClass: any, reactprops: any) { var reactpropNames = Object.getOwnPropertyNames(reactprops); for (let i = 0; i < reactpropNames.length; i++) { let renderPropName = reactpropNames[i]; bindable({ name: renderPropName, attribute: camelToKebab(renderPropName), defaultBindingMode: bindingMode.twoWay })(aureliaClass); } }