Last active
January 25, 2017 15:21
-
-
Save SvenPam/d979143ccdf9149b1c5e5d84ef43cfda to your computer and use it in GitHub Desktop.
Module Design Pattern for JS...because I always forget the template.
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
'use strict'; | |
// Module description | |
var module = (function ($) { | |
function privateFunction() | |
return { | |
publicFunction: function () { | |
privateFunction(); | |
} | |
} | |
}(jQuery)); | |
module.publicFunction(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on: https://addyosmani.com/resources/essentialjsdesignpatterns/book/