UNPKG

@visactor/vchart

Version:

charts lib based @visactor/VGrammar

23 lines (21 loc) 662 B
import { merge } from "@visactor/vutils"; import { CompilableBase } from "./compilable-base"; export class StateManager extends CompilableBase { compile() {} getStateMap() { return this._stateMap; } _getDefaultStateMap() { return {}; } constructor(options) { super(options), this.initStateMap(); } initStateMap(state) { this._stateMap = null != state ? state : this._getDefaultStateMap(); } updateState(newState, noRender) { if (newState && (merge(this._stateMap, newState), !noRender)) return this.getCompiler().renderNextTick(); } } //# sourceMappingURL=state-manager.js.map