Forest.js Core Documentation - v1.2.3
    Preparing search index...

    Type Alias ElementMeta

    Metadata associated with DOM elements. Used internally by Forest.js to maintain element states and bindings.

    const elementMeta: ElementMeta = ensureMeta(el) // <- "elementMeta" is a ElementMeta

    elementMeta.listeners = {
    click: () => console.log("Clicked!"),
    };

    elementMeta.mounted = true;

    elementMeta.triggers = new Set(["customTrigger"]);

    elementMeta.storeBindings = new Set([() => console.log("Cleanup store")]);
    type ElementMeta = {
        listeners?: Record<string, EventListener>;
        triggers?: Triggers;
        mounted?: boolean;
        storeBindings?: Set<() => void>;
    }
    Index

    Properties

    listeners?: Record<string, EventListener>

    Event listeners attached to the element.

    triggers?: Triggers

    Custom triggers for element-specific actions.

    mounted?: boolean

    Indicates whether the element is currently mounted in the DOM.

    storeBindings?: Set<() => void>

    A set of functions to clean up store bindings.