Replies: 1 comment 3 replies
-
It's not redundant, the purpose of the reactive part in there is to have a "global state management", so with this example you can use the same reactive part in two different applications in the same page. There's a comment in the example where you can see, the user can update that value outside the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all!
The example that I am referring to is this one here: https://github.com/vuejs/petite-vue#global-state-management.
I found that, whilst developing a Petite app, I didn't actually need to make my object
reactive()
for it to work with DOM updates.After some investigating I found that Petite makes any and all objects passed to it reactive (Fig 1)
My question is: Is the
reactive
method used in the Main Example a redundant usecase?Petite will run
reactive
on thestore
variable as soon as the app is created.This means that the
reactive
method ran earlier isn't actually changing anything?Let me know if I'm got my wires crossed or have misunderstood the example!
(Fig 1)
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions