Skip to content

Instantly share code, notes, and snippets.

@alexdev27
Last active January 31, 2017 05:20
Show Gist options
  • Save alexdev27/0b252553ca1239d2c89d9dbf56b3aa1a to your computer and use it in GitHub Desktop.
Save alexdev27/0b252553ca1239d2c89d9dbf56b3aa1a to your computer and use it in GitHub Desktop.
шаблон модуля из урока loftblog/loftschool
var mymodule = (function () {
//// переменные ////
//// ----------////
// Функция инициализации
var launchInit = function () {
_initVars(); // запуск инициализации переменных
_launchListeners();// запуск прослушки событий
};
var _initVars = function () {
// тут инициализируем переменные
};
var _launchListeners = function () {
// тут пишем код для прослушки событий
};
// другие функции располагаются здесь, до return
return {
init: launchInit
};
})();
mymodule.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment