Skip to content

Instantly share code, notes, and snippets.

@vespoli
vespoli / dataservice
Last active January 3, 2016 04:39
Data service class pattern for web service heavy front end projects. Supports calls to multiple sources with a single callback.
/*******************************************************************************
* Global data service utility "class"
*******************************************************************************/
NAMESPACE.DataService = function(){
var foo = {
set : function(obj, callback, errorConfig){
var payload = JSON.stringify(obj),
config = {
url: '/foo/update/',