1.0.2 • Published 4 years ago

small-module-js v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

small-module-js

Easy to use and small module script for in-browser usage.

Installation

npm install --save small-module-js

Usage

Module('App.Test', (function () {
    // Set variables for the scope:
    var container = document.querySelector('div#container');

    function handleClick(event) {
        console.log(event);
    }

    function registerEvent() {
        container.addEventListener('click', handleClick);
    }

    // Do everything for initialization:
    function initialize() {
        registerEvent();
    }

    return {
        initialize: initialize,
    };
}));

License

It's MIT.