Last active
July 10, 2023 04:54
-
-
Save guilhermepontes/4504159 to your computer and use it in GitHub Desktop.
Revisions
-
guilhermepontes revised this gist
Sep 12, 2018 . 2 changed files with 7 additions and 7 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ const Application = ((d) => { const privateVariable = 'Private content' const __private = { cache: () => { this.link = d.querySelector('.link') }, @@ -15,9 +15,9 @@ const Application = ((d) => { return { init: () => { __private.showContent() __private.cache() __private.bind() } } })(document) 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ var Application = (function(w, d){ var myPrivateVariable = "My private content"; var __private = { cache: function(){ this.link = d.querySelector('.link-item'); } @@ -19,8 +19,8 @@ var Application = (function(w, d){ init: function(){ console.log(myPrivateVariable); __private.cache(); __private.bind(); } }; })(window, document); -
guilhermepontes revised this gist
Sep 12, 2018 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,9 @@ const Application = ((d) => { const privateVariable = 'Private content' const _private = { cache: () => { this.link = d.querySelector('.link') }, bind: () => { @@ -21,7 +20,7 @@ const Application = (() => { _private.bind() } } })(document) Application.init() console.log(privateVariable) //undefined -
guilhermepontes revised this gist
Sep 12, 2018 . 1 changed file with 9 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,14 @@ const Application = (() => { const link = document.querySelector('.link') const _private = { cache: () => { this.link = document.querySelector('.link') }, bind: () => { this.link.addEventListener('click', this.showContent, false) }, showContent: () => console.log(privateVariable) } @@ -17,5 +23,5 @@ const Application = (() => { } })() Application.init() console.log(privateVariable) //undefined -
guilhermepontes revised this gist
Oct 13, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const Application = (() => { const _private = { cache: () => this.link = document.querySelector('.link'), bind: () => this.link.addEventListener('click', this.showContent, false), showContent: () => console.log(privateVariable) } -
guilhermepontes revised this gist
Oct 13, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,8 @@ const Application = (() => { const link = document.querySelector('.link') const _private = { cache: () => this.link = document.querySelector('.link'), bind: () => this.link.addEventListener('click', this.shoshowContentwVariableContent, false), showContent: () => console.log(privateVariable) } -
guilhermepontes renamed this gist
Apr 3, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
guilhermepontes revised this gist
Apr 3, 2017 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,6 @@ const Application = (() => { showContent: () => console.log(privateVariable) } return { init: () => { _private.showContent() -
guilhermepontes revised this gist
Apr 3, 2017 . 1 changed file with 22 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ const Application = (() => { const privateVariable = 'Private content' const link = document.querySelector('.link') const _private = { cache: () => (this.link = document.querySelector('.link')) bind: () => this.link.addEventListener('click', this.shoshowContentwVariableContent, false), showContent: () => console.log(privateVariable) } return { init: () => { _private.showContent() _private.cache() _private.bind() } } })() Application.init() // console.log(privateVariable) //undefined -
guilhermepontes revised this gist
Apr 3, 2017 . 1 changed file with 8 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ var Application = (function(w, d){ var myPrivateVariable = "My private content"; var _private = { cache: function(){ this.link = d.querySelector('.link-item'); } bind: function(){ this.link.addEventListener('click', this.handleClick, false); }, @@ -15,17 +15,15 @@ var app = (function(w, d){ } }; return { init: function(){ console.log(myPrivateVariable); _private.cache(); _private.bind(); } }; })(window, document); Application.init(); //init the app console.log(myPrivateVariable); // undefined -
guilhermepontes revised this gist
Sep 8, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ var app = (function(w, d){ cache : function(){ this.link = d.querySelector('.link-item'); } bind : function(){ this.link.addEventListener('click', this.handleClick, false); }, -
guilhermepontes revised this gist
Dec 10, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ var app = (function(w, d){ var myPrivateVariable = "My private content"; var __private = { -
guilhermepontes revised this gist
Mar 31, 2015 . 1 changed file with 13 additions and 13 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,30 +1,30 @@ var app = (function(d, w){ var myPrivateVariable = "My private content"; var __private = { cache : function(){ this.link = d.querySelector('.link-item'); } bind : function(){ this.link.addEventListener('click', this.handleClick, false); }, handleClick: function(){ console.log(myPrivateVariable); } }; var app = { init: function(){ console.log(myPrivateVariable); __private.cache(); __private.bind(); } }; return app; })(window, document); app.init(); //init the app console.log(myPrivateVariable); // undefined -
guilhermepontes revised this gist
Jan 12, 2015 . 1 changed file with 16 additions and 13 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,27 +1,30 @@ var app = (function(){ var myPrivateVariable = "My private content"; var __private = { bind: function(){ }, cache: function() { // impl } }; var app = { init: function(){ console.log(myPrivateVariable); __private.cache(); __private.bind(); }, blabla: function(){ // .... } }; return app; })(); app.init(); // > my private content app.myPrivateVariable; // > undefined -
guilhermepontes created this gist
Jan 10, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ var app; app = (function(){ var myPrivateVariable = "my private content"; var application = { init: function(){ console.log(myPrivateVariable); }, cache: function() { // impl }, bind: function() { // impl }, blabla: function(){ // .... } } return application; })(); app.init(); // > my private content app.myPrivateVariable // > undefined