Skip to content
This repository was archived by the owner on Apr 19, 2019. It is now read-only.
This repository was archived by the owner on Apr 19, 2019. It is now read-only.

Firestore subcollection example using nested modules #167

@bdiz

Description

@bdiz

I'm unable to see how to create a Vuex nested module hierarchy that maps to firestore collections, doc, subcollection structure that is compatible with Vuexfire and bindFirebaseRef.

I think if I saw and example of adding sub-tasks to todos in the todo module example you have it would become clear.

What I can't wrap my head around is if I have a component the iterates all todos and their sub-tasks in the template, the sub-task subcollection ref is different for each todo and I don't know how to have Vuexfire listening for snapshots for all subcollections.

I'm setting my setTodosRef in a component created() hook and this is fine because there is only one todos firestore collection. This doesn't work for subcollections because there are many. If I looped over todos and called my setSubTasksRef() action, my understanding is each time I called bindFirebaseRef('subTasks', subTasksRef) it would unbind the previous leaving only the last todo with sub-tasks listening for snapshots.

What am I missing? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions