fazlurr
2/7/2017 - 7:38 AM

JavaScript Module Function

JavaScript Module Function

<snippet>
	<content><![CDATA[
var ${1:Module} = (function () {
	"use strict";

	var module = {};

	var ${2:selector} = '';

	// Init
	module.init = function () {
		module.initSelector();
	};

	// Init Selector
	module.initSelector = function () {
		${2:selector} = ${3:selector};
	};

	return module;
})();
]]></content>
	<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
	<tabTrigger>mod</tabTrigger>
	<!-- Optional: Set a scope to limit where the snippet will trigger -->
	<scope>source.js</scope>
</snippet>