<commit_before>/**
 * Created by vladi on 25-Jan-17.
 */

import {dispatchEvent, getUid} from './EventsControl';

export default class Event {
    constructor(eventData) {
        //i don't want to keep the event prototype or constructor for comparing i will create unique id per constructor
        this.constructor.prototype._uid = this.constructor.prototype._uid || getUid();
        this.eventState = this.constructor.defaultEventState || {};
        this._data = {...(eventData || {})};
        this._eventState = this._uid = undefined;
    }

    get uid() {
        return this.constructor.prototype._uid;
    }

    set eventState(eventState) {
        this.constructor.prototype._eventState = this.constructor.prototype._eventState || {...(eventState || {})};
    }

    get eventState() {
        return {...this.constructor.prototype._eventState};
    }

    get eventData() {
        return {...this._data};
    }

    dispatch() {
        this.constructor.prototype._eventState = Object.assign(this.constructor.prototype._eventState, this._data);
        this.onEventStateUpdated(this);
        dispatchEvent(this);
    }

    static get eventState() {
        return this.prototype._eventState || (new this()).eventState;
    }

    static get uid() {
        return this.prototype._uid || (new this()).uid;
    }

    onEventStateUpdated() {
    }
}


<commit_msg>removed unnesesary functionality<commit_after>/**
 * Created by vladi on 25-Jan-17.
 */

import {dispatchEvent, getUid} from './EventsControl';

export default class Event {
    constructor(eventData) {
        //i don't want to keep the event prototype or constructor for comparing i will create unique id per constructor
        this.constructor.prototype._uid =
            this.constructor.prototype._uid || getUid();
        this.constructor.prototype._eventState =
            this.constructor.prototype._eventState || {...(this.constructor.defaultEventState || {})};
        this._data = {...(eventData || {})};
        this._eventState = this._uid = undefined;
    }

    get uid() {
        return this.constructor.prototype._uid;
    }

    get eventState() {
        return {...this.constructor.prototype._eventState};
    }

    get eventData() {
        return {...this._data};
    }

    dispatch() {
        this.constructor.prototype._eventState = Object.assign(this.constructor.prototype._eventState, this._data);
        dispatchEvent(this);
    }

    static get eventState() {
        return this.prototype._eventState || (new this()).eventState;
    }

    static get uid() {
        return this.prototype._uid || (new this()).uid;
    }
}



{'fraction_non_alphanumeric': 0.13058289174867524, 'fraction_numerical': 0.003028009084027252, 'mean_word_length': 2.5716216216216217, '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': '3080360', 'n_tokens_mistral': 734, 'n_tokens_neox': 713, 'n_words': 162}