Skip to content

feat(core): allow signal() to be called without an initial value#68743

Open
arturovt wants to merge 1 commit into
angular:mainfrom
arturovt:feat/core_64118
Open

feat(core): allow signal() to be called without an initial value#68743
arturovt wants to merge 1 commit into
angular:mainfrom
arturovt:feat/core_64118

Conversation

@arturovt
Copy link
Copy Markdown
Contributor

Adds a no-argument overload to signal() so undefined is inferred when no initial value is provided, matching the behavior of the input() API.

// before
name = signal<string | undefined>(undefined);

// after — `undefined` is inferred automatically
name = signal<string>();

Closes #64118

@angular-robot angular-robot Bot added detected: feature PR contains a feature commit area: core Issues related to the framework runtime labels May 15, 2026
@ngbot ngbot Bot added this to the Backlog milestone May 15, 2026
@arturovt arturovt marked this pull request as ready for review May 15, 2026 14:53
@pullapprove pullapprove Bot requested a review from JeanMeche May 15, 2026 14:53
Adds a no-argument overload to `signal()` so `undefined` is inferred when no initial value is provided, matching the behavior of the `input()` API.

```ts
// before
name = signal<string | undefined>(undefined);

// after — `undefined` is inferred automatically
name = signal<string>();
```

Closes angular#64118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Issues related to the framework runtime detected: feature PR contains a feature commit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support Signal Function without argument (undefined implied)

1 participant