Last active
February 11, 2024 22:13
-
-
Save Najki/3ee96ee2f377d6ec88a27ca40ae71cf6 to your computer and use it in GitHub Desktop.
JavaScript AMD Module pattern
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
/* global $, module, require, window, console, alert, confirm */ | |
var _ = require('underscore'); | |
module.exports = (function () { | |
'use strict'; | |
/** | |
* @private | |
* @type {boolean} | |
*/ | |
var privateVarExample = false, | |
/** | |
* @private | |
* @type {boolean} | |
*/ | |
secondPrivateVarExample = true; | |
/** | |
* Description | |
* | |
* @function | |
* @private | |
*/ | |
function privateFunctionExample() { | |
// | |
} | |
return { | |
/** | |
* Description | |
* | |
* @function | |
* @public | |
* @param {Object} params | |
*/ | |
publicFunctionExample: function (params) { | |
privateFunctionExample(); | |
}, | |
/** | |
* Description | |
* | |
* @function | |
* @public | |
*/ | |
initialize: function () { | |
this.publicFunctionExample(); | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment