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

A full refacto of `openDBChannel` based on our latest discoveries. #341

Closed louisameline closed 3 years ago

mesqueeb commented 4 years ago

I think, without that small change, it would break if someone does:

dispatch('someModule/openDBChannel', null, { root: true })

In this case null is actually passed as the parameters so it throws an error

"can't read clauses of undefined"

on the next line.

You're probably thinking "why in the world would someone pass null, which I thought so myself, but it's the official Vuex docs that actually have that pattern show in their examples...

Screenshot 2020-07-25 12 49 31

So yeah, we gotta think that some ppl will also pass null where we expect only either an object or undefined.

louisameline commented 4 years ago

Right, I overlooked the compatibility code block, but this line can actually also go away when we get rid of it, so it could be moved inside of it.

louisameline commented 3 years ago

This has to get merged, please don't let it rot until it has annoying conflicts again.

mesqueeb commented 3 years ago

Doing some final tests related to multiple tabs with a user today!