-
Is it possible to map the inner value of a resource to another value? This could be beneficial in a few cases, like for example say i have a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This seems to suggest something like I'd also note though that it's almost certainly the case that cloning Also, |
Beta Was this translation helpful? Give feedback.
This seems to suggest something like
Signal::derive(|| resource.map(|user| /* do something */))
would be appropriate for your use case.I'd also note though that it's almost certainly the case that cloning
User
is not going to be significant relative to the overall cost of doing things like rendering your UI in the DOM. (I'm assumingUser
is something like a handful of string fields)Also,
Rc
is serializable, you just need to have therc
feature enabled onserde
.