angular/packages/core/test/resource
Miles Malerba 2206efa55f feat(core): add special return statuses for resource params
Allows throwing from the resource's params function to transition the
resource to a status other than resolved.

In particular, the following values can be thrown from params:
- `ResourceParamsStatus.IDLE` causes the resource to become `idle`
  (equivalent to returning `undefined`)
- `ResourceParamsStatus.LOADING` causes the resource to become `loading`
- Any `Error` object causes the resource to become `error` and report
  the error that was thrown via `.error()`

To simplify chaining together resources, this PR also introduces a
context object passed into to the `params` functon. This context
contains a `chain` function that can be used to get the value of a
resource that the params want to depend on, while automatically
propagating the idle, loading, and erorr states of the resource forward.
2026-03-02 08:47:14 -08:00
..
BUILD.bazel feat(core): add special return statuses for resource params 2026-03-02 08:47:14 -08:00
chain_spec.ts feat(core): add special return statuses for resource params 2026-03-02 08:47:14 -08:00
params_status_spec.ts feat(core): add special return statuses for resource params 2026-03-02 08:47:14 -08:00
resource_snapshot_spec.ts feat(core): resource composition via snapshots 2026-01-12 13:49:56 -08:00
resource_spec.ts fix(core): fix narrowing of Resource.hasValue() (#63994) 2025-09-23 14:20:55 +00:00