src/index.js
function wrapComponent(component, elementName) {
  let bindableProps = [];
  if (component.propTypes) {
    bindableProps = Object.keys(component.propTypes).map(prop => bindable({
      name: prop,
      attribute: camelToKebab(prop),
      changeHandler: 'updateProps',
      defaultBindingMode: 1
    }));
  }
  return decorators(
    noView(),
    customElement(elementName),
    bindable({name: 'props', attribute: 'props', changeHandler: 'updateProps', defaultBindingMode: 1}),
    ...bindableProps
  ).on(createWrapperClass(component));
}
function wrapComponent(component, elementName) {
  let bindableProps = [];
  if (component.propTypes) {
    bindableProps = Object.keys(component.propTypes).map(prop => bindable({
      name: prop,
      attribute: camelToKebab(prop),
      changeHandler: 'updateProps',
      defaultBindingMode: 1
    }));
  }
  return decorators(
    noView(),
    customElement(elementName),
    bindable({name: 'props', attribute: 'props', changeHandler: 'updateProps', defaultBindingMode: 1}),
    ...bindableProps
  ).on(createWrapperClass(component));
}
function wrapComponent ( component , elementName ) { let bindableProps = [ ] ; if ( component . propTypes ) { bindableProps = Object . keys ( component . propTypes ) . map ( prop => bindable ( { name : prop , attribute : camelToKebab ( prop ) , changeHandler : 'updateProps' , defaultBindingMode : 1 } ) ) ; } return decorators ( noView ( ) , customElement ( elementName ) , bindable ( { name : 'props' , attribute : 'props' , changeHandler : 'updateProps' , defaultBindingMode : 1 } ) , ... bindableProps ) . on ( createWrapperClass ( component ) ) ; }
Wrap the React components into an ViewModel with bound attributes for the defined PropTypes
@param {Object} component
@param {string} elementName
@returns {Object}
Wrap the React components into an ViewModel with bound attributes for the defined PropTypes