Mutation Consistency

DOM++ uses a consistent mutation pattern across text, styles, attributes, children, events, and state.

Every setter can be used both for: initialization and updates.

Most setters also support derived mutation through callback syntax.

Important

Mutation consistency is one of the core DOMPP design principles.

All setters share the same mental model:

setSomething(next)

or

setSomething(current => next)

This keeps text, styles, attributes, children, events, and state mutations structurally consistent.

Shared Mutation Pattern

setSomething(
  next
);

setSomething(
  current => next
);