4 ms·
You'd save yourself one line of indentation if you encouraged module.exports = Controller; at the end of the file instead. Node already puts a closure around th
by xixixao 11y ago
You'd save yourself one line of indentation if you encouraged module.exports = Controller; at the end of the file instead. Node already puts a closure around the module, no need for another one.
- keithwhor 11y agoI like the IIFE because of the way it reads. A developer new to Node.js It's impossible to miss. Putting your export line at the bottom is begging for silly bugs. Even if they're quick fixes, still annoying.
- curun1r 11y agoSeems like: export default class ... would be the clearest and least bug-prone and satisfies the "no extra closures" complaint. Considering you're buying into other ES6isms, why not use that one too?
- keithwhor 11y agoWill definitely be changing the module system to ES6 in the future. For now I prefer this pattern. :)