Created
November 6, 2017 07:41
-
-
Save jsartisan/8de0c446befd6b575cbd23c6f93c8a95 to your computer and use it in GitHub Desktop.
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 characters
| var users = (function(){ | |
| var actions = { | |
| onClickSomeButton: function(e){ | |
| console.log('button clicked'); | |
| }, | |
| onKeyupSomeInput: function(e){ | |
| console.log('key is pressed'); | |
| } | |
| }; | |
| var form = { | |
| onSubmitSomeForm: function(e){ | |
| console.log('form is submitted'); | |
| } | |
| }; | |
| var bindEvents = function() { | |
| $('.js-some-button').click(actions.onClickSomeButton); | |
| $('.js-some-input').keyup(actions.onKeyupSomeInput); | |
| $('#js-some-form').submit(actions.onSubmitSomeForm); | |
| } | |
| var init = function(){ | |
| bindEvents(); | |
| } | |
| return { | |
| init : init | |
| } | |
| })(); | |
| module.exports = users; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment