view js function window VIEW window VIEW window VIEW showMyButton func

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// view.js
(function () {
window.VIEW = window.VIEW || {};
window.VIEW.showMyButton = function () { document.getElementById('my-button').style = 'display: block';
// ...
})();
// view-signin.js
(function () {
let obj = {
showForm() {/*...*/},
disableButton() {/*...*/},
/* ... */
};
window.VIEW = window.VIEW || {};
window.VIEW.SIGN_IN = obj;
})();
// signin.js
(function () {
window.VIEW.showMyButton();
window.VIEW.SIGN_IN.showForm();
})();