I would like to create a deep copy of data computed in the meteor object. I am trying this, but the mounted hook, threads is an empty object with an Observer and the subscription this.$subReady.threads
is undefined.
data() {
return {
threadsCopy: null,
}
},
meteor: {
$subscribe: {
'threads': []
},
threads () {
return Threads.find({}, {
sort: {date: -1}
})
},
},
mounted() {
this.$set(this, 'threadsCopy', JSON.parse(JSON.stringify(this.threads)));
}
Is there a way I can wait on the threads property to be initialized in my mounted function?