all files / model/ ChangeRecorder.js

100% Statements 6/6
100% Branches 0/0
100% Functions 2/2
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20                           
import TransactionDocument from './TransactionDocument'
import EditingInterface from './EditingInterface'
import DocumentChange from './DocumentChange'
 
export default
class ChangeRecorder extends EditingInterface {
 
  constructor(doc) {
    super(new TransactionDocument(doc))
  }
 
  generateChange() {
    const ops = this._document.ops.slice()
    this._document.ops.length = 0
    let change = new DocumentChange(ops, {}, {})
    change._extractInformation(this._document)
    return change
  }
 
}