angular/packages/core/test/resource
Alex Rickabaugh 168516462a feat(core): support default value in resource() (#59655)
Before `resource()` resolves, its value is in an unknown state. By default
it returns `undefined` in these scenarios, so the type of `.value()`
includes `undefined`.

This commit adds a `defaultValue` option to `resource()` and `rxResource()`
which overrides this default. When provided, an unresolved resource will
return this value instead of `undefined`, which simplifies the typing of
`.value()`.

PR Close #59655
2025-01-24 13:39:02 +01:00
..
BUILD.bazel feat(core): experimental resource() API for async dependencies (#58255) 2024-10-21 13:25:58 -07:00
resource_spec.ts feat(core): support default value in resource() (#59655) 2025-01-24 13:39:02 +01:00