sveltefire
sveltefire copied to clipboard
collectionStore seems to not be listening to real-time updates
I have a collectionStore referenced in firebase.ts:
it is referenced in another file
In this file, I have tried several methods to make the UI re-render when something changes in firebase.
here is a function where it is being used:
where it is called:
the filtered data is passed as props
when I add a new document to the backend, no re-render appears to happen. any console.log statement that I would expect to fire does not.
Hi @masonstevens95, please correct me if I'm wrong but it seems like you are trying to derive a variable from your store right? If so, then you should use a svelte derived store for your plantsByForestLayer.
const plantsByForestLayer = derived(
plantsByUUID,
($doc) => $doc.map(/* your code here */)
);
That way, you will be able to use plantsByForestLayer as a reactive variable in your template.