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

Provider fixes #2

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Provider fixes #2

wants to merge 1 commit into from

Conversation

sekaiking
Copy link
Collaborator

@sekaiking sekaiking commented Dec 9, 2023

Fixing handleDocument.fetchAll to fetch documents things.

The problem:
The Social.get works synchronously and returns null if it's still loading and cause the widget code to rerender only once, but in the case of fetchAll, we are fetching the project documents array first, then fetching each document alone, that means multiple retriggers are needed to not get null, but the init function is only getting 2 retriggers.

The solution:
The not so good solution I come out with, is to keep rerendering the widget code every 1s until fetchAll stops returning null. I don't like this solution, and I think the better way is to use Social.asyncGet and save the data in state or cache.

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

Successfully merging this pull request may close these issues.

1 participant