state(obj, val) {
        if (isString(obj)) {
            return baseState(this, obj, val);
        }

        this.context().batch();

        const oldState = {};
        each(obj, (value, prop) => {
            oldState[prop] = baseState(this, prop, value);
        });

        this.context().end();

        return oldState;
    }
Get or set a state value.

This is a base method and will not invoke related changes, for example
setting selected=false will not trigger any deselection logic.

@param {string|object} obj Property name or Key/Value state object.
@param {boolean} val New value, if setting.
@return {boolean|object} Old state object, or old value if property name used.