Created
May 19, 2025 12:38
-
-
Save lrsbt/a7f72476d2f88080abc12df8edc15bd2 to your computer and use it in GitHub Desktop.
Object Literal Module Pattern in Javascript
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
const TEMPLATE = { | |
init() { | |
this.cacheDom(); | |
this.bindEvents(); | |
this.render(); | |
}, | |
cacheDom() { | |
// cache selectors | |
}, | |
bindEvents() { | |
// bind jQuery events | |
}, | |
render() { | |
console.log('Rendering'); | |
} | |
}; | |
jQuery(() => TEMPLATE.init()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment