<commit_before>import {observable, computed, reaction} from 'mobx';


export default class PlayerStore {
	@observable player = {
	    name: 'Willy'
    };
	@observable level = 1;

	@computed get completedCount() {
		return this.todos.length - this.activeTodoCount;
	}

	@computed get levelCount() {
	    return this.level;
    }

	subscribeServerToStore() {
		reaction(
			() => this.toJS(),
			todos => fetch('/api/todos', {
				method: 'post',
				body: JSON.stringify({ todos }),
				headers: new Headers({ 'Content-Type': 'application/json' })
			})
		);
	}

	subscribeLocalstorageToStore() {
		reaction(
			() => this.toJS(),
			todos => localStorage.setItem('mobx-react-todomvc-todos', JSON.stringify({ todos }))
		);
	}

	addTodo (title) {
		this.todos.push(new TodoModel(this, Utils.uuid(), title, false));
	}

	changeName(name) {
	    player.name = name;
    }

    changeLevel(level) {
	    this.level = level;
    }
}<commit_msg>Prepare player store for refactoring<commit_after>import {observable} from 'mobx';

import * as storage from 'services/localStorage';
import * as playerService from 'services/player';

class PlayerStore {
    @observable player = {};

    constructor() {
        this.player = storage.get('player');
    }

    resetTimer() {
        this.timer = 0;
    }

    changeName(name) {
        this.player.name = name;
    }
}

export default PlayerStore;
{'fraction_non_alphanumeric': 0.1468682505399568, 'fraction_numerical': 0.0014398848092152627, 'mean_word_length': 3.161676646706587, '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': '3671955', 'n_tokens_mistral': 505, 'n_tokens_neox': 459, 'n_words': 97}