Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
titleInstead store state in Javascript objects

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.

...