Last active
October 14, 2016 15:25
-
-
Save commuterjoy/efff5a11ac03a9169cc307e7b3fd4388 to your computer and use it in GitHub Desktop.
This file contains 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 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