Skip to content

Instantly share code, notes, and snippets.

@michael
Created December 18, 2015 15:11
Show Gist options
  • Select an option

  • Save michael/8a9f6dd18f8051662dcf to your computer and use it in GitHub Desktop.

Select an option

Save michael/8a9f6dd18f8051662dcf to your computer and use it in GitHub Desktop.
DB OPERATIONS
=================================
{}
Substance Storage API
========================
// Connect to scope
storage.insertChanges('note-25', [SubstanceOperation, SubstanceOperation]);
storage.delete('note-25'); // delete all data in scope
store.getChanges('note-13); // all changes!
// Get snapshot
storage.getSnapshot('change-sha-12'); // give me a Substance.DataGraph
Substance Websocket API
========================
ws.insertChanges = function(changes) {
var result = storage.insertChanges(changes);
ws.return(result);
};
Substance Notepad App (JS Client)
========================
// Get a note for the notepad
hub.getSnapshot('note-13', 'change-sha-12');
// History slider
hub.getChanges('note-13); // all changes!
//
hub.insertChanges('note-13', [Changes...])
server.getNote('lkasdj flaj')
notepad.html#documentId=asfljsd:lkadf ad
Substance Storage API
========================
createOperations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment