Newer
Older
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
import { shallowMergeArray } from '../mol-util/object';
import { RxEventHelper } from '../mol-util/rx-event-helper';
protected get ev() {
return this._ev || (this._ev = RxEventHelper.create());
}
private _state: State;
protected updateState(...states: Partial<State>[]): boolean {
const latest = this.state;
const s = shallowMergeArray(latest, states);
if (s !== latest) {
dispose() {
if (this._ev) this._ev.dispose();
constructor(initialState: State) {