-
-
Notifications
You must be signed in to change notification settings - Fork 346
Closed
Description
I'm building a comment system using Vuefire.
I'm trying to recursively resolve child comments.
It works one level deep for rending to the HTML but any more than that the reactive doesn't seem to update. I'm not sure if this is the correct way to do it. I'm trying to $bind to properties of an object I've already used $bind on. Is this possible? Here is my code. Note level isn't used yet but it was how I was going to limit the depth.
async resolveChildComments(comments, level, template) {
for (let idx = 0; idx < 1 && comments.length; idx++) {
let comment = comments[idx];
console.log('level', level, 'comment', comment, 'idx', idx, 'children', comment.children, template)
const parent = db.collection('comments').doc(comment.id);
await this.$bind(`${template}.${idx}.children`, db.collection('comments').where('parent', '==', parent).orderBy('rating', 'desc').orderBy('meta.createdAt', 'desc'));
await this.resolveChildComments(comments[idx].children, level + 1, `${template}.${idx}.children`)
}
}
await this.resolveChildComments(this.selectedPostComments, 0, 'selectedPostComments');
Metadata
Metadata
Assignees
Labels
No labels