WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Discussion options

You must be logged in to vote

As has been mentioned in #16189, one can wrap the value in a $state proxy to get deep reactivity in derived values.

$derived.by(() => {
    let val = $state(...);
    return val;
});
function proxify(value) {
    const proxified = $state(value);
    return proxified;
}

let foo = $derived(proxify(...));

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@aster-void
Comment options

@peterreeves
Comment options

@aster-void
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by aster-void
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants