mesqueeb / vuex-easy-firestore

Easy coupling of firestore and a vuex module. 2-way sync with 0 boilerplate!
https://mesqueeb.github.io/vuex-easy-firestore
MIT License
234 stars 28 forks source link

Gaurding on array #308

Closed riksnelders closed 4 years ago

riksnelders commented 4 years ago

Is it possible at all to gaurd the following setup:

image

Children can have children (up to 3 deep) wich is an array of objects. I have no need of saving the selected/editing. I don't think its possible to gaurd this with the config?

What do u suggest:

mesqueeb commented 4 years ago

Hi @riksnelders thanks for your ticket! It's not possible to guard on an array.

As you said, it's possible to re-map the entire array every time before syncing inside a hook, but I would not suggest this, as it would cause a lot of overhead.

Instead, I would say, if it's not "sensitive" data, just go ahead and sync it with the rest of your data. It's only a few extra bytes so will hardly make a difference. Also, firebase won't charge you more or less anyway. 😅

--
Vuex Easy Firestore was made with ♥ by Luca Ban.
If you use this library in your projects, you can support the maintenance of this library by a small contribution via Github 💜.
You can also reach out on twitter if you want a one-on-one coding review/lesson. 🦜