I have a list of firebase documents in a vuex store, and that list gets dynamically updated. I would like to bind the documents in that list dynamically with vuexfire.
state: {
docsToBind: [], // dynamic: this gets updated so I cannot hardcode a few bindings
documents: {} // bind documents here?
},
actions:{
bindOne: firestoreAction(({ state, bindFirestoreRef }) => {
return bindFirestoreRef(...)
}),
bindAll({state}){
for(const doc of state.docsToBind){
// bind the document to a dictionary item?
},
unbindTeam({state}){
// whenever a doc is removed from the listunbind it
}
}
Is this the right way to do it?
Note: I cannot bind the entire collection, because the client doesn't have access to all the documents. So I need to bind the subset in docsToBind