mesqueeb/vuex-easy-firestore

Gaurding on array

riksnelders opened this issue ยท 1 comments

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:

  • not saving it at all
  • using a hook to prevent this from being inserted into firestore?

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. ๐Ÿฆœ