setState(newState, actionName) {
    if (typeof newState === 'object') {
      let oldstate = this.state;

      skipInProductionAndTest(() => oldstate = clone(this.state));

      this.state = Object.assign(oldstate, newState);

      skipInProductionAndTest(() => Object.freeze(this.state));

      if (this.$config.listen) {
        this.__$privateStore.setState(newState);
      }
    }

    if (!this.$config.listen && typeof this.view === 'function' && this.html) {
      this.html = patch(this.html, this.view());
    }

    if (typeof actionName === 'string' && typeof this[actionName] === 'function') {
      this.trigger(`after${capitalise(actionName)}`, newState);
    }

    // if (typeof newState === 'object') {
    //   let oldstate = this.state;
    //
    //   skipInProductionAndTest(() => oldstate = clone(this.state));
    //
    //   this.state = Object.assign(oldstate, newState);
    //
    //   skipInProductionAndTest(() => Object.freeze(this.state));
    //
    //   if (this.$config.listen) {
    //     this.__$privateStore.setState(newState);
    //   }
    // }
    //
    // if (!this.$config.listen && typeof this.view === 'function' && this.html) {
    //   fuseDom.fuse(this.html, this.view());
    // }
    this.trigger('update');

    return newState;
  }
@param {object} newState
@param {string} actionName