Created
June 20, 2022 08:45
-
-
Save MarcelloDiSimone/4be8fe9c0d00715c6898d825f68e30f7 to your computer and use it in GitHub Desktop.
Closure function boilerplate
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
/** | |
* @module namespace/Closure | |
* @requires module:namespace/Model | |
* @lends namespace | |
*/ | |
(function (window) { | |
'use strict'; | |
/** | |
* @namespace | |
*/ | |
var namespace = window.namespace; | |
/** | |
* @class | |
* @memberOf namespace | |
* @constructor | |
* @description Closure constructor | |
* @param {namespace.Model} model Model instance | |
*/ | |
function Closure(model) { | |
/** | |
* @description Model instance | |
* @private | |
* @type {namespace.Model} | |
*/ | |
this._model = model; | |
} | |
Closure.prototype = /** @lends namespace.Closure.prototype */ { | |
constructor: Closure, | |
/** | |
* @description Example method | |
* @public | |
* @constructs | |
* @param [param] string | |
* @returns {boolean} | |
*/ | |
doSomething: function (param) { | |
return param !== undefined; | |
} | |
}; | |
window.namespace = window.namespace || {}; | |
window.namespace.Closure = Closure; | |
})(window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment