<commit_before>module.exports = (function () {
  var Vue = require("Vue");

  var MediumEditorComponent = Vue.extend({
    template: "<div><textarea v-model=\"content\"></textarea></div>",

    props: ["content"],

    ready: function () {
      var self = this;
      var MediumEditor = require("medium-editor");

      var editorToDataSync = function (data, editable) {
        self.content = editable.innerHTML;
      };

      this.editor = new MediumEditor(this.$el.children[0]);
      this.editor.subscribe("editableInput", editorToDataSync);

      this.$on("data-updated", function () {
        this.editor.setContent(this.content);
      });
    }
  });

  return MediumEditorComponent;
})();
<commit_msg>Fixed component to update editor on changes to data from parent<commit_after>module.exports = (function () {
  var Vue = require("Vue");

  var MediumEditorComponent = Vue.extend({
    template: "<div><textarea v-model=\"content\"></textarea></div>",

    props: ["content"],

    ready: function () {
      var self = this;
      var MediumEditor = require("medium-editor");

      var editorToDataSync = function (data, editable) {
        self.content = editable.innerHTML;
      };

      this.editor = new MediumEditor(this.$el.children[0]);
      this.editor.subscribe("editableInput", editorToDataSync);

      this.$watch("content", function () {
        this.editor.setContent(this.content);
      });
    }
  });

  return MediumEditorComponent;
})();

{'fraction_non_alphanumeric': 0.1565040650406504, 'fraction_numerical': 0.0013550135501355014, 'mean_word_length': 3.148876404494382, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6549086', 'n_tokens_mistral': 439, 'n_tokens_neox': 412, 'n_words': 86}