<commit_before>import Graphics from 'flockn/graphics';

var isVisible = function isVisible() {
  var hasVisibleFlag = Object.hasOwnProperty.call(this, 'visible');

  if (hasVisibleFlag) {
    return this.visible;
  } else {
    return true;
  }
};

var renderable = function renderable() {
  this.on('render', () => {
    // Only render if element is visible
    if (!isVisible.call(this)) {
      return;
    }

    // Emit `render` event on the `Graphics` object
    Graphics.trigger('render', this);

    // Render all children elements
    this.children.forEach(child => child.trigger('render'));
  });
};

export default renderable;
<commit_msg>Use checkForFlag in render mixin<commit_after>import checkForFlag from 'flockn/utils/checkforflag';
import Graphics from 'flockn/graphics';

var isVisible = checkForFlag('visible');

var renderable = function renderable() {
  this.on('render', () => {
    // Only render if element is visible
    if (!isVisible.call(this)) {
      return;
    }

    // Emit `render` event on the `Graphics` object
    Graphics.trigger('render', this);

    // Render all children elements
    this.children.forEach(child => child.trigger('render'));
  });
};

export default renderable;

{'fraction_non_alphanumeric': 0.13502454991816695, 'fraction_numerical': 0.0, 'mean_word_length': 3.5634328358208953, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '323910', 'n_tokens_mistral': 365, 'n_tokens_neox': 358, 'n_words': 98}