Which @angular/* package(s) are relevant/related to the feature request?
No response
Description
I'm experimenting now with the new resource and rxResource new APIs and one thing that is a bit hassle is that it adds undefined to the the type of it
for example I find myself needing a lot to do resource.value() ?? [] because before I was making the signal value empty array till the value is loaded
Proposed solution
is to add initial value to the ResourceOptions
points to be discussed
- if
hasValue() should be true or false if it's the initial value
- when
resource.reload() is called if it should return to the default value or not
Alternatives considered
is to keep using ?? initialValue
Which @angular/* package(s) are relevant/related to the feature request?
No response
Description
I'm experimenting now with the new resource and rxResource new APIs and one thing that is a bit hassle is that it adds undefined to the the type of it
for example I find myself needing a lot to do
resource.value() ?? []because before I was making the signal value empty array till the value is loadedProposed solution
is to add initial value to the ResourceOptions
points to be discussed
hasValue()should be true or false if it's the initial valueresource.reload()is called if it should return to the default value or notAlternatives considered
is to keep using
?? initialValue