Skip to content

Why this code not excute like I want? #913

Answered by dai-shi
zmm2tysu asked this question in Q&A
Discussion options

You must be logged in to vote
const state = useProxy(GlobalStore.data.obj1);
// 👆 means like this 👇 
const foo = GlobalStore.data.obj1;
const state = useProxy(foo);

// When you do this:
GlobalStore.data = {obj1: {text: 'world'}}
// `foo` doesn't change

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@zmm2tysu
Comment options

@dai-shi
Comment options

@zmm2tysu
Comment options

Answer selected by zmm2tysu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants