3 ms·
I've seen the issue of new hires, time after time, getting a small ui ticket and immediately asking, "where is the client store?" or "Why aren't we using Redux,
by bmeski 5y ago
I've seen the issue of new hires, time after time, getting a small ui ticket and immediately asking, "where is the client store?" or "Why aren't we using Redux, it'll clean up our code a bunch."
Of 20+ applicants I've interviewed this year, only 2 knew about element.dataset and how to create a basic state scoped to that vanilla JS "component".
The issue is groupthink and using the hammer on everything.
- onion2k 5y agoThe point of Redux (or any state library) is to share state between components. Unless you're doing something like putting the state for a child in the data- attributes of a parent somewhere further up the tree I don't think element.dataset does the same job at all. element.dataset is much closer to something like using useState.
- wonnage 5y agoIt's probably because invoking DOM APIs is terribly slow and if you're accessing those fields with any frequency you're better off using a JS object.
- bmeski 5y agoThe point was that there are many ways to solve the problem. For say, a simple tab layout where you add click handlers to the tabs and hide/ show the contents, you would never notice any latency using the DOM apis. The DOM apis are the core of web development. You need to know them and consider them before moving into the abstraction atop.