Combining reactive_stores with resources and hydration #3679
-
Hello friends! I'm looking to switch to leptos from node/react stack and decided to write a small production-like app to see how it works, but trying to combine the patterns in the book in one app seems challenging to me. Here's what I want to achieve:
Seemingly, Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
There are really two separate questions here, I think.
The first half ("upgrade returned data to signals") doesn't follow from the second half ("trigger refetch on client and have updates shown immediately"), although the second half is also confusing to me. Resources can be mutated like signals, so there is no need to upgrade a resource to a signal to be able to have updates on the client. Resources can also be manually refetched, or invalidated and refetched with their source signal. Happy to try to help with any of that if you have an example, or to try to give another response if I'm misunderstanding. |
Beta Was this translation helpful? Give feedback.
If you want to do that with a resource then as far as I know, currently the best way to do it would be to make a memo of the current value of each entry (that's Option 3 here) but I can't say I've done much work with examples like this personally.