-
Notifications
You must be signed in to change notification settings - Fork 26.3k
feat(core): Resources api change #60610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ef2b989
to
f5bb124
Compare
efd6d08
to
7825c04
Compare
7825c04
to
2a9d55c
Compare
2a9d55c
to
0b9fe8a
Compare
388387f
to
ad797ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ad797ad
to
ca83bd2
Compare
After the approvals were done I changed the error message from: 'Resource failed to load' to `Resource is currently in the error state'. I also removed untracking of the stream https://github.com/angular/angular/pull/60610/files#diff-16f6b7cc4c4e69b511c8312d38c6cf71c412e6f1d6ac9092054c0f349215cdedR418, because there were some cases in g3, where |
ca83bd2
to
f788f52
Compare
f788f52
to
886c7ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reviewed-for: public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reviewed-for: public-api
ff4cfdc
to
3161918
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: public-api
It was set to es2022 for build tsconfig in https://github.com/angular/angular/pull/60066/files#diff-7ec658aedc62a693cc513accc8f360938d90bcbdb09aa79c1401e56fe84f5fd3, but was missed for the main one.
Now only mutable resources can be reloaded BREAKING CHANGE: * `Resource.reload` has been moved to `WritableResource.reload`.
`Resource.error` used to return `unknown`. Now it's `Error | undefined`. For non-`Error` types they are encapsulated with the `Error` type. BREAKING CHANGE: * `Resource.error` now has a type of `Signal<Error | undefined>` instead of `Signal<unknown>`
…g undefined When there is an underlying error state it would not be possible to swallow the error with: `computed(() => res.value()?.inner);` BREAKING CHANGE: * `Resource.value()` now throws an error when it's in an error state. Previously it returned `undefined`.
When the resource is loading after reloading from the error state reading `Resource.value()` would return the default value instead of throwing an error. This change prevents `Resource.hasValue()` from throwing an error in such a case. BREAKING CHANGE: * `Resource.value()` now returns a default value when in a loading state after reloading the error state
3795382
to
5e62b07
Compare
Since I was one of the people mentioning error typing during the RFC, I'm wondering about two things:
|
Changes landed as part of #61441 |
Uh oh!
There was an error while loading. Please reload this page.