add (action, params) {
    this.index++
    this.history[this.index] = {
      action,
      params,
      timestamp: new Date()
    }

    // remove redo actions which are invalid now
    if (this.index < this.history.length - 1) {
      this.history.splice(this.index + 1, this.history.length - this.index - 1)
    }

    // fire onchange event
    this.onChange()
  }
Add a new action to the history
@param {String} action  The executed action. Available actions: "editField",
                        "editValue", "changeType", "appendNode",
                        "removeNode", "duplicateNode", "moveNode"
@param {Object} params  Object containing parameters describing the change.
                        The parameters in params depend on the action (for
                        example for "editValue" the Node, old value, and new
                        value are provided). params contains all information
                        needed to undo or redo the action.