Open tedchwang opened 5 years ago
Hello. The current implementation needs to be improved, because a module will remember the last where filters and create an "identifier" based on that.
https://github.com/mesqueeb/vuex-easy-firestore/blob/master/src/module/actions.ts#L521
That means if you closeDBChannel it will only close the one with the latest filters....
I have to improve this behaviour. Thanks for noticing!
You can mutate this mutation before each closeDBChannel
:
commit('SET_SYNCFILTERS', {where, orderBy})
You need to pass an object with an array for both where
and orderBy
.
See the source code for SET_SYNCFILTERS here.
Feel free to make a PR helping me improve this behaviour or anything related to the way openDBChannel identifiers are saved to be closed later.
I plan to only re-write this part for version 2.0, unless if you make a good PR, I might keep that implementation in v2.0.
Until then please use this work around. 😉
--
Vuex Easy Firestore was made with ♥ by Luca Ban.
If this library helped you in any way you can support me by buying me a cup of coffee. ☕️
You can also reach out on twitter if you want a one-on-one coding review/lesson. 🦜
After about two years of open source, I finally got accepted for Github Sponsors!
A little about me:
BTW, donations get's paid DOUBLE by GitHub! (they're alchemists... 🦾)
Going forward 👨🏼💻
Hi @tedchwang, version 1.35.2
will help you accomplish what you wish channel by channel, thanks to stop()
.
In the future, it is likely that we'll deprecate closeDBChannel
in favor of some closeDBChannels
action, which will close all channels of the module. I'll leave this issue open until we do.
Hello Luca!
Thank you for this great tool. I'm reading the documentation and I am wondering if we
openDBChannel
multiple times on myModule but with differentwhere()
filters, will we be able to selectivelycloseDBChannel
, or doescloseDBChannel
detach all listeners born from myModule?