graph-database.js
/**
   Collect and return all accumulated patches
   in the process, convert from abstract form
   
     {put: [], post: [], delete: []}
   
   where each array entry is 
   
     [identifier, propertyName, value]

   to capture the respective operation on the identifier object
   */
Collect and return all accumulated patches
in the process, convert from abstract form





[identifier, propertyName, value]

to capture the respective operation on the identifier object
Collect and return all accumulated patches in the process convert from abstract form [ identifier propertyName value ] to capture the respective operation on the identifier object
asPatch() {
    var thisStore = this;
    var posts = [];
    var puts = [];
    var deletes = [];
    thisStore.patches.forEach(function(patch) {
      deletes = deletes.concat(patch.delete || []);
      posts = posts.concat(patch.post || []);
      puts = puts.concat(patch.put || []);
    });
    thisStore.objects.forEach(function(object, id) {
      var patch = object.asPatch();
      deletes = deletes.concat(patch.delete || []);
      posts = posts.concat(patch.post || []);
      puts = puts.concat(patch.put || []);
    });
    var patch = thisStore.environment.createPatch({delete: deletes, post: posts, put: puts});
    thisStore.cleanObjects();
    return (patch);
  }
asPatch ( ) { var thisStore = this ; var posts = [ ] ; var puts = [ ] ; var deletes = [ ] ; thisStore . patches . forEach ( function ( patch ) { deletes = deletes . concat ( patch . delete || [ ] ) ; posts = posts . concat ( patch . post || [ ] ) ; puts = puts . concat ( patch . put || [ ] ) ; } ) ; thisStore . objects . forEach ( function ( object , id ) { var patch = object . asPatch ( ) ; deletes = deletes . concat ( patch . delete || [ ] ) ; posts = posts . concat ( patch . post || [ ] ) ; puts = puts . concat ( patch . put || [ ] ) ; } ) ; var patch = thisStore . environment . createPatch ( { delete : deletes , post : posts , put : puts } ) ; thisStore . cleanObjects ( ) ; return ( patch ) ; }
Collect and return all accumulated patches
in the process, convert from abstract form
Collect and return all accumulated patches in the process convert from abstract form
// console.log('asPatch: forEach: ', id, object); // console.log('asPatch: deletes,posts,puts', deletes, posts, puts);