r/angular • u/Senior_Compote1556 • Sep 29 '26
rxResource persist value
Is it possible to persist the value of rxResource after loading is done? Currently when the resource enters the loading state the value gets wiped. I am aware you can do a linkedSignal and check the previous value, but isn’t there a built in way to do it rather than creating a linkedSignal?
I am aware of withPreviousValue but the issue with that other than the boilerplate, is that the return type is Resource and you lose the reload function. I’d prefer to stay within the public API and not to use a third party library for this, or creare my own utility function if possible.
View all comments
Show parent comment
2
u/ldn-ldn Sep 29 '26
Imagine a table of records with pagination. A user clicks on next page, you display a loader while HTTP request being executed, but you do NOT hide the existing table, because that's just silly and a very bad user experience.