stax-monorepo
    Preparing search index...

    Type Alias SignalStruct

    SignalStruct namespace.

    type SignalStruct = {
        isSignalStruct: (
            value: unknown,
        ) => value is SignalStruct<Record<string, unknown>>;
        make: <T extends Record<string, unknown>>(
            initial: T,
        ) => Effect<SignalStruct<T>, never, Scope>;
        SignalStructTypeId: symbol;
        trace: (
            id: string,
        ) => <T extends Record<string, unknown>>(
            self: Effect<SignalStruct<T>, never, Scope>,
        ) => Effect<SignalStruct<T>, never, Scope>;
    }
    Index
    isSignalStruct: (
        value: unknown,
    ) => value is SignalStruct<Record<string, unknown>>

    Check if a value is a SignalStruct.

    make: <T extends Record<string, unknown>>(
        initial: T,
    ) => Effect<SignalStruct<T>, never, Scope>

    Create a new SignalStruct with an initial value.

    Type Declaration

      • <T extends Record<string, unknown>>(
            initial: T,
        ): Effect<SignalStruct<T>, never, Scope>
      • Type Parameters

        • T extends Record<string, unknown>

        Parameters

        • initial: T

          The initial struct value

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

    SignalStructTypeId: symbol
    trace: (
        id: string,
    ) => <T extends Record<string, unknown>>(
        self: Effect<SignalStruct<T>, never, Scope>,
    ) => Effect<SignalStruct<T>, never, Scope>

    Log every struct-level mutation call on a SignalStruct 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 SignalStruct. Wraps update and replace — the struct-level mutations. Field signals (struct.name.set(...) etc.) are plain Signals and can be traced individually with Signal.trace if needed.

    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 user = yield* Signal.Struct.make({
    name: "Ada",
    email: "a@b.co",
    }).pipe(Signal.Struct.trace("user"));
    yield* user.update({ name: "Ada L." });
    // Debug logs:
    // stax.signal "update" { id: "user", args: [{...}], callSite: "..." }