Primitives / foldkit-primitives/observers

Mutation

const · packages/primitives/src/observers/mutation.ts:25

const Mutation: Mount.MountDefinitionNoArgs<
  'Mutation',
  {
    readonly _tag: 'Mutated'
    readonly type: 'attributes' | 'characterData' | 'childList'
    readonly added: readonly string[]
    readonly removed: readonly string[]
    readonly attribute: string | null
  }
>

DOM mutations as a Mount: MutationObserver reports child, attribute, and text changes as Messages for the element carrying this Mount. Nodes cross as their names (serializable); the live nodes stay in the DOM, never in the Model. No observer (SSR, old browser) emits nothing instead of throwing. Observes the whole subtree — narrow by placing on a smaller element, not by options.

In the guides