all files / packages/persistence/ SaveHandlerStub.js

0% Statements 0/3
100% Branches 0/0
0% Functions 0/1
0% Lines 0/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23                                             
class SaveHandlerStub {
 
  /*
    Saving a document involves two steps.
 
    - syncing files (e.g. images) with a backend
    - storing a snapshot of the document's content (e.g. a XML serialization)
  */
  saveDocument({fileManager}) {
    console.info('Simulating save ...')
 
    return fileManager.sync()
    .then(() => {
      // Here you would run a converter (HTML/XML) usually
      // and send the result to a REST endpoint.
      console.info('Creating document snapshot...')
    })
 
  }
}
 
export default SaveHandlerStub