Skip to content

Instantly share code, notes, and snippets.

@littlebeeper
Last active March 18, 2021 06:20
Show Gist options
  • Save littlebeeper/81e9708c881661e865d06dec743f942d to your computer and use it in GitHub Desktop.
Save littlebeeper/81e9708c881661e865d06dec743f942d to your computer and use it in GitHub Desktop.
Simple javascript module declaration
const moduleName = ((wnd,doc,$)=>{
'use strict';
const onReady = (callback)=>{
if (doc.readyState !== "loading")
callback();
else
doc.addEventListener("DOMContentLoaded", callback);
}
onReady(()=>{
}
);
function xFunction() {}
return {
publicFunction: xFunction
}
}
)(window, document, jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment