The document object model (DOM) of the browser is a complicated place Many web applications use DOM elements to store application state. It’s better to store application state in pure Javascript objects to achieve simpler designs with have better performance and less complexity.
Expand | ||
---|---|---|
| ||
It’s better to represent application state information in Javascript objects which should be the source of truth and then just display this information in the DOM. i.e. Application State In Javascript → rendered into → DOM never DOM → state extracted → Application state. |
...