2 ms·
This kind of reminded me of the module pattern [1] popular with ye olde jQuery plugins. Just realized that hooks try to emulate what JS does natively, which is
by orange8 4y ago
This kind of reminded me of the module pattern [1] popular with ye olde jQuery plugins. Just realized that hooks try to emulate what JS does natively, which is keeping track of all local variables in a functions calling scope. Meaning that if that function returns an object, that Object still has access to all the variables declared when that function run.
[1] https://stackoverflow.com/questions/17776940/javascript-module-pattern-with-example https://stackoverflow.com/questions/17776940/javascript-modu...