Late initialized deep reactivity #1207
Unanswered
balage1551
asked this question in
Help and Questions
Replies: 1 comment
-
After some digup, I found a solution. Using Vue.observable did the trick: this.projects.clear()
raw.forEach(p => {
this.projects.set(p.id, Vue.observable(p))
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a store which will store a relatively large data with complex structure: the top level of my business data is an array of
project
s which is a complex object. I would like to make a (lookup) map structure to access aproject
with a given id.I define a state field called
projects
(tried both being an object [old school] or being a Map), but as the data is not yet fetched it is an empty object.When I fetched the data, I would like to populate the
projects
map but with reactivity. Something you would do in Vue byVue.set
orthis.$set
.Is there a way to make a complex object reactive in Pinia?
Beta Was this translation helpful? Give feedback.
All reactions