Skip to content

Instantly share code, notes, and snippets.

View eldavido's full-sized avatar

David R. Albrecht eldavido

View GitHub Profile
# backbone_sync.coffee
# Defines a synchronization strategy that works with the Google Gadgets container
# options hash:
# "manualOverride" defines a callback that takes the "obj" parameters from
# makeRequest; intended for manually inspecting/parsing the service response.
# "success" and "error" are like their Backbone.js equivalents.
# "nocache" if truthy, ignore the value in makeRequest() cache.
Backbone.sync = (method, model, options) ->
syncParams = {}
syncParams[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON