<commit_before>import Service from '@ember/service';
import { isNone } from '@ember/utils';

var storage = {
  'local': window.localStorage,
  'session': window.sessionStorage,
};

export default Service.extend({

  prefix: 'es',
  type: 'local',

  _prefix(key) {
    return this.get('prefix')+'__'+key;
  },

  didInsertElement() {
    this._super(...arguments);

    let self = this,
        regexp = new RegExp('^('+this.get('prefix')+'__)');

    this._notify = function(evnt) {
      self.notifyPropertyChange(evnt.key.replace(regexp, ''));
    };

    window.addEventListener('storage', this._notify, false);
  },

  willDestroy() {
    this._super(...arguments);
    window.removeEventListener('storage', this._notify, false);
  },

  unknownProperty(k) {
    var key = this._prefix(k),<commit_msg>Fixed init function<commit_after>import Service from '@ember/service';
import { isNone } from '@ember/utils';

var storage = {
  'local': window.localStorage,
  'session': window.sessionStorage,
};

export default Service.extend({

  prefix: 'es',
  type: 'local',

  _prefix(key) {
    return this.get('prefix')+'__'+key;
  },

  init() {
    this._super(...arguments);

    let self = this,
        regexp = new RegExp('^('+this.get('prefix')+'__)');

    this._notify = function(evnt) {
      self.notifyPropertyChange(evnt.key.replace(regexp, ''));
    };

    window.addEventListener('storage', this._notify, false);
  },

  willDestroy() {
    this._super(...arguments);
    window.removeEventListener('storage', this._notify, false);
  },

  unknownProperty(k) {
    var key = this._prefix(k),
{'fraction_non_alphanumeric': 0.1780821917808219, 'fraction_numerical': 0.0, 'mean_word_length': 3.6579710144927535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6685965', 'n_tokens_mistral': 519, 'n_tokens_neox': 506, 'n_words': 95}