<commit_before>import m from 'mithril';

function controller() {
  return {
    message: m.prop(''),
  };
}

function view(ctrl) {
  return (
    <div className="entry">
      <input
        className="entry__input"
        autocomplete="off"
        onchange={m.withAttr('value', ctrl.message)}
        value={ctrl.message()}
      />
      <button type="button" className="entry__send">
        Send
      </button>
    </div>
  );
}

const Entry = { controller, view };

export default Entry;<commit_msg>submit message with button<commit_after>import m from 'mithril';

function controller() {
  return {
    message: m.prop(''),

    send() {
      const { message } = this;

      if(message()) {
        // TODO: replace with emitter
        console.log(message());
        message('');
      }
    },
  };
}

function view(ctrl) {
  return (
    <div className="entry">
      <input
        className="entry__input"
        autocomplete="off"
        onchange={m.withAttr('value', ctrl.message)}
        value={ctrl.message()}
      />
      <button type="button" className="entry__send" onclick={() => ctrl.send()}>
        Send
      </button>
    </div>
  );
}

const Entry = { controller, view };

export default Entry;
{'fraction_non_alphanumeric': 0.15691056910569107, 'fraction_numerical': 0.0, 'mean_word_length': 2.4194444444444443, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 14, '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': '5079400', 'n_tokens_mistral': 373, 'n_tokens_neox': 367, 'n_words': 81}