Skip to content

refactor(multiple): explicitly type untyped RxJS Subject instances - #34191

Merged
crisbeto merged 1 commit into
angular:mainfrom
jonathan-meier:type-untyped-rxjs-subjects
Nov 27, 2026
Merged

crisbeto merged 1 commit into
angular:mainfrom
jonathan-meier:type-untyped-rxjs-subjects

Conversation

@jonathan-meier

Copy link
Copy Markdown
Contributor

Add explicit type arguments to untyped new Subject() instances whose .next() method is called with no arguments.

In RxJS 7, Subject.next(value: T) requires an argument unless T is void (or includes void), so calling .next() with no arguments on an untyped Subject<unknown> fails to type-check. Typing these subjects explicitly fixes RxJS 7 compatibility without changing runtime behavior.

@pullapprove
pullapprove Bot requested review from crisbeto and ok7sai November 27, 2026 00:46
Add explicit type arguments to untyped `new Subject()` instances whose
`.next()` method is called with no arguments.

In RxJS 7, `Subject.next(value: T)` requires an argument unless `T` is
`void` (or includes `void`), so calling `.next()` with no arguments on
an untyped `Subject<unknown>` fails to type-check. Typing these subjects
explicitly fixes RxJS 7 compatibility without changing runtime behavior.
@jonathan-meier
jonathan-meier force-pushed the type-untyped-rxjs-subjects branch from af8945c to a90594c Compare November 27, 2026 01:35
@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Nov 27, 2026
@crisbeto
crisbeto merged commit ae4e993 into angular:main Nov 27, 2026
33 of 35 checks passed
@crisbeto

Copy link
Copy Markdown
Member

This PR was merged into the repository. The changes were merged into the following branches:

crisbeto pushed a commit that referenced this pull request Nov 27, 2026
…34191)

Add explicit type arguments to untyped `new Subject()` instances whose
`.next()` method is called with no arguments.

In RxJS 7, `Subject.next(value: T)` requires an argument unless `T` is
`void` (or includes `void`), so calling `.next()` with no arguments on
an untyped `Subject<unknown>` fails to type-check. Typing these subjects
explicitly fixes RxJS 7 compatibility without changing runtime behavior.

Co-authored-by: Jonathan Meier <jome@google.com>
(cherry picked from commit ae4e993)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants