feat(signals): add resource extensions#5167
Open
markostanimirovic wants to merge 2 commits into
Open
Conversation
cd35ccf to
2c1cc39
Compare
timdeschryver
approved these changes
Jun 23, 2026
cbd57d5 to
2dc56b6
Compare
5cecd0b to
08b7876
Compare
rainerhahnekamp
approved these changes
Jul 2, 2026
| - **Value on loading** - when a resource reloads, `value()` resets to `undefined` until the new data arrives. | ||
| - **Value on error** - when a resource enters the error state, reading `value()` throws. | ||
|
|
||
| The `extendResource` function, together with the built-in extensions, addresses both cases without losing access to the APIs of more specific resource types, such as `WritableResource`. |
Contributor
There was a problem hiding this comment.
I would directly address here the open question, namely the difference to the native snapshots. To me the additional benefits are the ability of having
- A
WritableSignal - The option to define them globally.
So I would rephrase it like
Suggested change
| The `extendResource` function, together with the built-in extensions, addresses both cases without losing access to the APIs of more specific resource types, such as `WritableResource`. | |
| Unlike the native `resourceFromSnapshots` function, which downcasts the output to a base `Resource`, `extendResource` can be configured globally and fully preserves the capabilities of writable types like `WritableResource`. |
Member
Author
There was a problem hiding this comment.
I'd avoid mentioning resourceFromSnapshot in case this limitation gets solved on the Angular side in the meantime.
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.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Closes #5126
Does this PR introduce a breaking change?