How to use the deep-diff.revertChange function in deep-diff

To help you get started, we’ve selected a few deep-diff examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spring-raining / Giraf / src / stores / history.js View on Github external
undo() {
    const lastChange = this._commitStack.pop();
    if (lastChange) {
      for (let i = lastChange.changes.length - 1; i >= 0; i--) {
        let change = lastChange.changes[i];
        revertChange(change.target, true, change);
      }
      this._revertStack.push(lastChange);
    }
  }

deep-diff

Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.

MIT
Latest version published 6 years ago

Package Health Score

73 / 100
Full package analysis