(i)
| 2948 | i.mode && (i.currentModeIndex = this.state.modes.indexOf(i.mode)), this.state = { ...this.state, ...i }, this._notifyStateChange(t, this.state), this.container && this.render(this.container); |
| 2949 | } |
| 2950 | onStateChange(i) { |
| 2951 | return this.onStateChangeHandlers.push(i), () => { |
| 2952 | const t = this.onStateChangeHandlers.indexOf(i); |
| 2953 | t !== -1 && this.onStateChangeHandlers.splice(t, 1); |
| 2954 | }; |
| 2955 | } |
| 2956 | _notifyStateChange(i, t) { |
| 2957 | this.onStateChangeHandlers.forEach((n) => n(i, t)); |
| 2958 | } |