Skip to content

Instantly share code, notes, and snippets.

@MarcelloDiSimone
Created June 20, 2022 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarcelloDiSimone/4be8fe9c0d00715c6898d825f68e30f7 to your computer and use it in GitHub Desktop.
Save MarcelloDiSimone/4be8fe9c0d00715c6898d825f68e30f7 to your computer and use it in GitHub Desktop.
Closure function boilerplate
/**
* @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