Title: extend streaming resource with {status} capability · Issue #59712 · angular/angular · GitHub
Open Graph Title: extend streaming resource with {status} capability · Issue #59712 · angular/angular
X Title: extend streaming resource with {status} capability · Issue #59712 · angular/angular
Description: Which @angular/* package(s) are relevant/related to the feature request? core Description After playing around with the new streaming resource in 19.2.0-next.0 I thought about different usecases where I would like to use this. First: the...
Open Graph Description: Which @angular/* package(s) are relevant/related to the feature request? core Description After playing around with the new streaming resource in 19.2.0-next.0 I thought about different usecases wh...
X Description: Which @angular/* package(s) are relevant/related to the feature request? core Description After playing around with the new streaming resource in 19.2.0-next.0 I thought about different usecases wh...
Opengraph URL: https://github.com/angular/angular/issues/59712
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"extend streaming resource with {status} capability","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\n\ncore\n\n### Description\n\nAfter playing around with the new streaming resource in 19.2.0-next.0 I thought about different usecases where I would like to use this.\n\nFirst: the resource is only in \"Loading\" state when a new request is emitted until the promise resolves with the first (signal of) value. Afterwards, when a new value is emitted the resource will just update. This is fine!\n\nBut what if the implementation \"knows\" when it is fetching a value?\n\nExample 1: Polling\n\nImagine some API which doesn't support streaming, so it has to be polled. The \"poller\" would then know when it is going to fetch the next value (even on the same request).\n\nExample 2: Retry\n\nImagine some streaming resource implementation which automatically retries after an error occured. It will then know when it is \"Reloading\".\n\n### Proposed solution\n\nExtend the type of the signal with\n\n```ts\n{ value: T }\n| { error: unknown }\n| { status: ResourceStatus.Loading | ResourceStatus.Reloading }\n```\nWhen the signal of the streaming resource emits a \"status\" the `Resource\u003cT\u003e` transitions to the given state (I don't think the other `ResourceStatus` values make sense here).\n\n### Alternatives considered\n\nCurrently the implementation would have to encode the (re)loading information into its value and that can't be populated to the `Resource\u003cT\u003e`'s status.","author":{"url":"https://github.com/flensrocker","@type":"Person","name":"flensrocker"},"datePublished":"2025-01-25T09:37:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/59712/angular/issues/59712"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8c0bd7c2-2500-7a80-638b-d80be5f853dd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ADF8:1BF5D2:30FE84D:3FB2F30:6974E9F3 |
| html-safe-nonce | 8e1a10dde298721b40493351202931e5b5642ad925a75131b453518c40d7863d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBREY4OjFCRjVEMjozMEZFODREOjNGQjJGMzA6Njk3NEU5RjMiLCJ2aXNpdG9yX2lkIjoiODYzNDc4OTczNzU2MDA3NDczOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5430d25ccd1d001ab20723a579f51c62c395cc8b55d8c01f51472248aaae857e |
| hovercard-subject-tag | issue:2810887304 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/59712/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e8e922f304f46e65ef5111515b2b59660c619e789a314b89b1d947a692cbcda8/angular/angular/issues/59712 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e8e922f304f46e65ef5111515b2b59660c619e789a314b89b1d947a692cbcda8/angular/angular/issues/59712 |
| og:image:alt | Which @angular/* package(s) are relevant/related to the feature request? core Description After playing around with the new streaming resource in 19.2.0-next.0 I thought about different usecases wh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | flensrocker |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width