How to use the skatejs/dist/esnext/util.keys function in skatejs

To help you get started, we’ve selected a few skatejs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pattern-lab / patternlab-node / packages / uikit-base / preact-component / base-skate-element.js View on Github external
function defineProps(constructor) {
  if (constructor.hasOwnProperty('_propsNormalized')) return;
  const { props } = constructor;
  keys(props).forEach(name => {
    let func = props[name] || props.any;
    if (defaultTypesMap.has(func)) func = defaultTypesMap.get(func);
    if (typeof func !== 'function') func = prop(func);
    func({ constructor }, name);
  });
}
github pattern-lab / patternlab-node / packages / uikit-base / preact-component / base-skate-element.js View on Github external
set props(props) {
    const ctorProps = this.constructor.props;
    keys(props).forEach(k => k in ctorProps && (this[k] = props[k]));
  }
github pattern-lab / patternlab-node / packages / uikit-base / preact-component / base-skate-element.js View on Github external
get props() {
    return keys(this.constructor.props).reduce((prev, curr) => {
      prev[curr] = this[curr];
      return prev;
    }, {});
  }