stax-monorepo
    Preparing search index...

    Type Alias SignalSet

    SignalSet namespace.

    type SignalSet = {
        isSignalSet: (value: unknown) => value is SignalSet<unknown>;
        make: <T>(
            initial?: ReadonlySet<T> | Iterable<T, any, any>,
        ) => Effect<SignalSet<T>, never, Scope>;
        SignalSetTypeId: symbol;
        trace: (
            id: string,
        ) => <T>(
            self: Effect<SignalSet<T>, never, Scope>,
        ) => Effect<SignalSet<T>, never, Scope>;
    }
    Index
    isSignalSet: (value: unknown) => value is SignalSet<unknown>

    Check if a value is a SignalSet.

    make: <T>(
        initial?: ReadonlySet<T> | Iterable<T, any, any>,
    ) => Effect<SignalSet<T>, never, Scope>

    Create a new SignalSet with optional initial values.

    Type Declaration

      • <T>(
            initial?: ReadonlySet<T> | Iterable<T, any, any>,
        ): Effect<SignalSet<T>, never, Scope>
      • Type Parameters

        • T

        Parameters

        • Optionalinitial: ReadonlySet<T> | Iterable<T, any, any>

          Initial values as a Set or iterable

        Returns Effect<SignalSet<T>, never, Scope>

    SignalSetTypeId: symbol
    trace: (
        id: string,
    ) => <T>(
        self: Effect<SignalSet<T>, never, Scope>,
    ) => Effect<SignalSet<T>, never, Scope>

    Log every mutation call on a SignalSet 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 SignalSet. Wraps add, delete, toggle, clear, replace, and update 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.

    const tags = yield* Signal.Set.make<string>().pipe(Signal.Set.trace("tags"));
    yield* tags.add("urgent");
    // Debug logs:
    // stax.signal "add" { id: "tags", args: ["urgent"], callSite: "..." }