<commit_before>export default function mutationManager(
    stateIdFieldName='stateId',
    mutateFieldName='mutate',
) {
    return function (target) {
        const mutating = Symbol('mutating');
        const stateId = Symbol('stateId');
        return class extends target {
            get [stateIdFieldName]() { return this[stateId] || 0; }
            [mutateFieldName](executor) {
                if (!this[mutating]) {
                    try {
                        this[mutating] = true;
                        executor();
                    } finally {
                        this[mutating] = false;
                        this[stateId] = this[stateIdFieldName] + 1;
                        this.onMutate && this.onMutate();
                    }
                } else {
                    executor();
                }
            }
        };
    };
}<commit_msg>onMutate field name<commit_after>export default function mutationManager(
    stateIdFieldName='stateId',
    mutateFieldName='mutate',
    onMutateFieldName='onMutate',
) {
    return function (target) {
        const mutating = Symbol('mutating');
        const stateId = Symbol('stateId');
        return class extends target {
            get [stateIdFieldName]() { return this[stateId] || 0; }
            [mutateFieldName](executor) {
                if (!this[mutating]) {
                    try {
                        this[mutating] = true;
                        executor();
                    } finally {
                        this[mutating] = false;
                        this[stateId] = this[stateIdFieldName] + 1;
                        this[onMutateFieldName] && this[onMutateFieldName]();
                    }
                } else {
                    executor();
                }
            }
        };
    };
}
{'fraction_non_alphanumeric': 0.10491803278688525, 'fraction_numerical': 0.002185792349726776, 'mean_word_length': 1.266089108910891, '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': '1755651', 'n_tokens_mistral': 473, 'n_tokens_neox': 441, 'n_words': 85}