class { onCreate(input) { this.state = { count: 0 } } handleClick() { this.state.count++; this.once('update', () => { this.emit('change', this.state.count); }); } }