Created
October 28, 2012 17:36
-
-
Save danielmahal/3969241 to your computer and use it in GitHub Desktop.
Olav example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = { | |
url: 'http://...' | |
}; | |
var loadXML = function(url) { | |
} | |
var getXML = (function() { | |
var cache = {}; | |
return function(url) { | |
cache[url] = cache[url] || loadXML(url); | |
} | |
})(); | |
getXML(config.url); | |
var Connection = function(options) { | |
this.url = options.url; | |
this.user = options.user; | |
this.pass = options.pass; | |
} | |
_.extend(Connection.prototype, { | |
put: function() { | |
}, | |
get: function() { | |
} | |
}); | |
var connection = new Connection({ | |
url: 'http://', | |
user: 'dsa', | |
pass: 'dsa' | |
}); | |
connection.put('lolz'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment