stax-monorepo
    Preparing search index...

    Type Alias SignalMap

    SignalMap namespace.

    type SignalMap = {
        isSignalMap: (value: unknown) => value is SignalMap<unknown, unknown>;
        KeyNotFoundError: typeof KeyNotFoundError;
        make: <K, V>(
            initial?: ReadonlyMap<K, V> | Iterable<readonly [K, V], any, any>,
        ) => Effect<SignalMap<K, V>, never, Scope>;
        SignalMapTypeId: symbol;
        trace: (
            id: string,
        ) => <K, V>(
            self: Effect<SignalMap<K, V>, never, Scope>,
        ) => Effect<SignalMap<K, V>, never, Scope>;
    }
    Index
    isSignalMap: (value: unknown) => value is SignalMap<unknown, unknown>

    Check if a value is a SignalMap.

    KeyNotFoundError: typeof KeyNotFoundError
    make: <K, V>(
        initial?: ReadonlyMap<K, V> | Iterable<readonly [K, V], any, any>,
    ) => Effect<SignalMap<K, V>, never, Scope>

    Create a new SignalMap with optional initial entries.

    Type Declaration

      • <K, V>(
            initial?: ReadonlyMap<K, V> | Iterable<readonly [K, V], any, any>,
        ): Effect<SignalMap<K, V>, never, Scope>
      • Type Parameters

        • K
        • V

        Parameters

        • Optionalinitial: ReadonlyMap<K, V> | Iterable<readonly [K, V], any, any>

          Initial entries as a Map or iterable of [key, value] pairs

        Returns Effect<SignalMap<K, V>, never, Scope>

    SignalMapTypeId: symbol
    trace: (
        id: string,
    ) => <K, V>(
        self: Effect<SignalMap<K, V>, never, Scope>,
    ) => Effect<SignalMap<K, V>, never, Scope>

    Log every mutation call on a SignalMap at Debug level, tagged under the stax.signal subsystem, with the call site captured at the caller's frame.

    The write-side counterpart to Readable.debug, for SignalMap. Wraps set, delete, clear, replace, update, and modifyAt so each call emits { id, args, callSite }. Zero cost at the default log level — the check runs once at construction and returns the underlying signal unwrapped if Debug isn't enabled.

    Unlike Signal.trace (which logs from/to), collection tracing logs the method name and its arguments — a full snapshot of the map on every write would be expensive and rarely what you want. Pair with Readable.debug if you also want a "value changed" line.

    const users = yield* Signal.Map.make<string, User>().pipe(
    Signal.Map.trace("users"),
    );
    yield* users.set("ada", { name: "Ada" });
    // Debug logs:
    // stax.signal "set" { id: "users", args: ["ada", {...}], callSite: "..." }