Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Last active October 14, 2016 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save commuterjoy/efff5a11ac03a9169cc307e7b3fd4388 to your computer and use it in GitHub Desktop.
Save commuterjoy/efff5a11ac03a9169cc307e7b3fd4388 to your computer and use it in GitHub Desktop.
var SalesForce = (function () {
// private
var connection = { foo: 'bar' }; // create the connection here
// public
return {
// expose the connection object
connection: connection,
login: (callback) => {
console.log('login', connection.foo);
},
logout: (callback) => {
console.log('logout', connection.foo);
}
}
}());
// usage
SalesForce.login();
SalesForce.logout();
SalesForce.connection;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment