<commit_before>import { h, render as preactRender } from 'preact';

import { HTMLElement, sym } from './util';
import { withProps } from './with-props';
import { withRender } from './with-render';
import { withUnique } from './with-unique';

const _preactDom = sym('_preactDom');

function render (vnode, root) {
  const dom = preactRender(vnode, root, this[_preactDom]);
  if (!this[_preactDom]) {
    this[_preactDom] = dom;
  }
}

export const withComponent = (Base = HTMLElement) => class extends withUnique(withRender(withProps(Base))) {
  rendererCallback (shadowRoot, renderCallback) {
    render.call(this, renderCallback(), shadowRoot);
  }
};

export const Component = withComponent();
export { h };<commit_msg>Get rid of unnecessary extra function<commit_after>import { h, render } from 'preact';

import { HTMLElement, sym } from './util';
import { withProps } from './with-props';
import { withRender } from './with-render';
import { withUnique } from './with-unique';

const _preactDom = sym('_preactDom');

export const withComponent = (Base = HTMLElement) => class extends withUnique(withRender(withProps(Base))) {
  rendererCallback (shadowRoot, renderCallback) {
    const dom = render(renderCallback(), shadowRoot, this[_preactDom]);
    if (!this[_preactDom]) {
      this[_preactDom] = dom;
    }
  }
};

export const Component = withComponent();
export { h };
{'fraction_non_alphanumeric': 0.14554670528602462, 'fraction_numerical': 0.0, 'mean_word_length': 4.7824267782426775, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7019947', 'n_tokens_mistral': 416, 'n_tokens_neox': 419, 'n_words': 116}