/**
 * Tiny listener-set primitive for pure event signals (no stored state).
 *
 * Use this when subscribers only need to know "something happened",
 * not "what is the current value".
 *
 * Usage:
 *   const changed = createSignal()
 *   const unsub = changed.subscribe(() => console.log("changed"))
 *   changed.emit()
 */
export function createSignal() {
    const listeners = new Set();
    return {
        subscribe(listener) {
            listeners.add(listener);
            return () => {
                listeners.delete(listener);
            };
        },
        emit(...args) {
            for (const listener of listeners)
                listener(...args);
        },
        clear() {
            listeners.clear();
        },
    };
}
//# sourceMappingURL=signal.js.map