'use strict'; const Dispatcher = require('./Dispatcher'); class CounterStore extends Dispatcher.Store { init () { this._initState(); Dispatcher.on('submit', (text) => { this.setText(text); this.emit('change'); }); } getState () { return this.state; } _initState () { this.state = { text: 'hello' }; } setText (text) { this.state.text = text; } } module.exports = new CounterStore();