Skip to content

Instantly share code, notes, and snippets.

@hojberg
Created February 13, 2010 12:27
Show Gist options
  • Save hojberg/303424 to your computer and use it in GitHub Desktop.
Save hojberg/303424 to your computer and use it in GitHub Desktop.
how to make testing possible of sandboxed api #1
(function () {
var PublicAPI = window.PublicAPI = {};
PublicAPI.publicFunction = function (foo) {
PrivateAPI.privateFunction(foo);
return 'bar';
};
var PrivateAPI = {};
PrivateAPI.privateFunction = function (foo) {
// Make secret stuff that never gets returned to the public
// Could be an XHR call.
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment