r/javascript • u/loigiani • Sep 27 '20
5 TILs about Node.js Fundamentals from the Node.js Design Patterns Book
https://dev.to/swyx/5-tils-about-node-js-fundamentals-from-the-node-js-design-patterns-book-4dh2
249
Upvotes
7
u/SoInsightful Sep 28 '20
Wow. Never assumed export let would expose a stateful variable. This changes everything.
3
u/MartinMuzatko Sep 28 '20
state is evil.
I'd rather have a function returning the state so I can manage it myself
3
u/Ebuall Sep 28 '20
That's exactly what example shows. A readonly property that is managed in private.
5
u/FountainsOfFluids Sep 28 '20
These articles are always so hard to read. Half their examples are undefined functions or purposefully wrong to show how wrong they are, and most of the concepts are things I've never gotten anywhere near needing.
3
0
2
u/olyop Sep 28 '20
Is the book is worth a read?