Open sne11ius opened 5 years ago
Great idea. It's not on my prio list at the moment, so contributions would be very helpful for this. Cheers!
Did either of you happen to do this yet? I'm trying to get it working now and... Well, let's just say it's not.
firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error: firestorter: cannot get firestore: Error:....
etc.
Looking into this, I think that perhaps firestorter or even mobx wouldn't make sense with next.js.
I found this article which explains how you could use mobx in next, but it feels clunky to me.
Zeit's swr seems capable of listeners and such as well. Working with small functional components with swr should yield the same result as working with firestorter and mobx.
By this I mean that you could set up a new onSnapshot
listener on a collection/document and use swr's mutate
to maintain it locally (so, use Mode.On basically).
To make it "smart" it'd have to be an effect with counters to check if anyone is observing though, so something could be done there.
But if all that is needed is a check to see if anyone is listening to the data I wouldn't use mobx for that. It's a pretty large library for something that could be solved with useEffect. The obvious downside is that you basically have to use hook. But that doesn't seem avoidable anymore anyway so... Why not.
I hope my ramblings help anyone. If not, well, at least I got to ramble.
I'm also getting the Error: firestorter: cannot get firestore: Error: firest...
issue with next.js, so just arrived here from google. :D I'm not sure where to init, since I'm basically recreating an app that works in firebase hosting.
Just want to say I enjoyed your ramble.
This is not a real "issue", but rather a suggestion: a minimal example of how to use firestorter with nextjs and SSR would be awesome ;)