Created
July 10, 2015 13:52
-
-
Save curioustechizen/98652aca149352c1fcc5 to your computer and use it in GitHub Desktop.
Revisions
-
curioustechizen created this gist
Jul 10, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ "Revealing Module Pattern with constructor": { "prefix": "reveal", "body": [ "var ${1:ModuleName} = (function () {", " var that,", " constr = function (${2:constr_param}) {", " that = this;", " this.$2 = $2;", " },", "", " ${3:privateFn} = function () {", " var temp = that.$2;", " };", "", " constr.prototype = {", " constructor: $1,", " $3: $3", " };", "", " return constr;", "})();" ], "description": "An implementation of revealing module pattern with a constructor" } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ var ModuleName = (function () { var that, constr = function (constr_param) { that = this; this.constr_param = constr_param; }, privateFn = function () { var temp = that.constr_param; }; constr.prototype = { constructor: ModuleName, privateFn: privateFn }; return constr; })();