Skip to content

Instantly share code, notes, and snippets.

@kborchers

kborchers/example.js

Created Sep 15, 2012
Embed
What would you like to do?
// 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
You can’t perform that action at this time.