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

Prefixing v-e-f actions #327

Open dsl101 opened 4 years ago

dsl101 commented 4 years ago

I have an app that I'm slowly porting over to use v-e-f and firestore, and have just been stuck for an hour trying to work out why my clearUser action wasn't being executed. I eventually found the answer here :) I couldn't see any reference to this in the documentation via the search at the top of the page, nor did there seem to be a full API list of all actions / mutations.

In any case, it would be great if there was a prefix for all the v-e-f actions so that I could keep my app using clearUser. Perhaps this could be done at initialisation like this:

const easyFirestore = VuexEasyFirestore(
  [myModule],
  {
    prefix: 'vef_',          // ← Allow all actions / mutations to be prefixed
    logging: true,
    FirebaseDependency: Firebase
  }
)

and then dispatch actions with dispatch('vef_openDBChannel') and so on.

dsl101 commented 4 years ago

I did the easy bit, and put some warning code in here #328