Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collectionStore seems to not be listening to real-time updates #117

Open
masonstevens95 opened this issue Aug 14, 2023 · 1 comment
Open

Comments

@masonstevens95
Copy link

I have a collectionStore referenced in firebase.ts:

image

it is referenced in another file

image

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:

image

where it is called:

image

the filtered data is passed as props

image

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.

@JeremyVoisin
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants