State and rendering

The state and render principle separates the application's data (the state) from its display (the render). You modify the state, then a render function updates the DOM from it, rather than changing the interface piece by piece. The state becomes the source of truth and the interface stays consistent.

Example

const etat = { taches: [] }
function rendre() { liste.replaceChildren(...etat.taches.map(creerLi)) }

Related concepts

The whole glossary