fix(core): derive possible null value in rxResource stream params#68167
Closed
surajy93 wants to merge 1 commit intoangular:mainfrom
Closed
fix(core): derive possible null value in rxResource stream params#68167surajy93 wants to merge 1 commit intoangular:mainfrom
surajy93 wants to merge 1 commit intoangular:mainfrom
Conversation
When an optional params function returns undefined, Angular's rxResource internally defaults the params loader value to null at runtime. This change updates `ResourceLoaderParams<R>` to correctly allow `null` alongside the resolved type, ensuring developers get accurate TypeScript feedback when omitted. Fixes angular#62724
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Member
|
Sorry, this doesn't pass the threshold of worty PR. This is obviously AI generated, wasn't tested because it doesn't work and is breaking. |
surajy93
pushed a commit
to surajy93/angular
that referenced
this pull request
Apr 13, 2026
surajy93
pushed a commit
to surajy93/angular
that referenced
this pull request
Apr 13, 2026
surajy93
pushed a commit
to surajy93/angular
that referenced
this pull request
Apr 13, 2026
Align resource and rxResource typings with the runtime null sentinel when params are omitted or undefined.
surajy93
added a commit
to surajy93/angular
that referenced
this pull request
Apr 13, 2026
Align resource and rxResource typings with the runtime null sentinel when params are omitted or undefined.
surajy93
added a commit
to surajy93/angular
that referenced
this pull request
Apr 13, 2026
Align resource and rxResource typings with the runtime null sentinel when params are omitted or undefined.
surajy93
added a commit
to surajy93/angular
that referenced
this pull request
Apr 13, 2026
…gular#68167) Align resource and rxResource typings with the runtime behavior when params are missing or explicitly undefined.
surajy93
added a commit
to surajy93/angular
that referenced
this pull request
Apr 13, 2026
…r#68167) Align resource and rxResource typings with the runtime null sentinel when params are omitted or explicitly undefined.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an optional params function returns
undefined, Angular'srxResourceinternally defaults the params loader value tonullat runtime. This change updatesResourceLoaderParams<R>to correctly allownullalongside the resolved type, ensuring developers get accurate TypeScript feedback when omitted.Fixes #62724
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When the
paramsoption is not provided torxResourceor it evaluates toundefined, the type of theparamsargument in the internalstreamfunction is restricted to the strictly inferred type (e.g.Params), even though it resolves tonullat runtime.Issue Number: #62724
What is the new behavior?
The type inference for
ResourceLoaderParams<R>correctly derives a potentialnullvalue in instances whereundefinedcould be inferred from the originalparamsoption payload. This correctly aligns the TypeScript expectations withinstreamorloaderfunctions to match the runtime behavior.Does this PR introduce a breaking change?
Other information
N/A