Skip to content

isWritableSignal type guard #64763

@FrenchFriesFiesta

Description

@FrenchFriesFiesta

Which @angular/* package(s) are relevant/related to the feature request?

core

Description

Currently there is no builtin way to check that an unknown value is a writable signal or not. isSignal exists but it only tells us that the value is a Signal, not if it is writable.

Proposed solution

An isWritableSignal would be much appreciated!

Alternatives considered

Checking manually with

(isSignal(x) && 'set' in x && typeof x.set === 'function')

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimecross-cutting: signalshelp wantedAn issue that is suitable for a community contributor (based on its complexity/scope).

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions