Skip to content

Instantly share code, notes, and snippets.

@kborchers
Created September 15, 2012 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kborchers/3729174 to your computer and use it in GitHub Desktop.
Save kborchers/3729174 to your computer and use it in GitHub Desktop.
// All taken from https://github.com/aerogear/aerogear-js/blob/master/src/pipeline/adapters/rest.js
// When creating a new REST based pipe, a recordId can be configured
// An app using the lib can then use what ever record identifier it wants
aerogear.pipeline.adapters.rest = function( pipeName, recordId, settings ) { ... }
// Then during a save, I can check for a value assigned to that id to determine the request type
type = data[ this.recordId ] ? "PUT" : "POST";
// After that we get into whether or not data sync is happening, etc. but I do not rely on a particular record identifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment