<commit_before>import features from 'features';

const featureInstances = features.map(Feature => new Feature());

// This poll() function will only need to run until we find that the DOM is ready
(function poll() {
  if (typeof Em !== 'undefined' && typeof Ember !== 'undefined' &&
    typeof $ !== 'undefined' && $('.ember-view.layout').length &&
    typeof ynabToolKit !== 'undefined') {
    featureInstances.forEach((feature) => {
      if (feature.settings.enabled && feature.shouldInvoke()) {
        feature.applyListeners();
        feature.invoke();
      }
    });
  } else {
    setTimeout(poll, 250);
  }
}());<commit_msg>Fixing bug where just because shouldInvoke returned false the first time, the feature’s event listeners were never applied, even though the feature was enabled.<commit_after>import features from 'features';

const featureInstances = features.map(Feature => new Feature());

// This poll() function will only need to run until we find that the DOM is ready
(function poll() {
  if (typeof Em !== 'undefined' && typeof Ember !== 'undefined' &&
    typeof $ !== 'undefined' && $('.ember-view.layout').length &&
    typeof ynabToolKit !== 'undefined') {
    featureInstances.forEach((feature) => {
      if (feature.settings.enabled) {
        feature.applyListeners();

        if (feature.shouldInvoke()) feature.invoke();
      }
    });
  } else {
    setTimeout(poll, 250);
  }
}());
{'fraction_non_alphanumeric': 0.15091678420310295, 'fraction_numerical': 0.004231311706629055, 'mean_word_length': 3.607142857142857, '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': '4573954', 'n_tokens_mistral': 383, 'n_tokens_neox': 379, 'n_words': 122}