Skip to content

feat(react): add useQuery and useStatus hooks #142

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

Merged
merged 21 commits into from
Apr 30, 2024

Conversation

DominicGBauer
Copy link
Contributor

Description

Implement new hooks

Work Done

  • Added useQuery hook
  • Added useStatus hook
  • Deprecated usePowersyncWatchedQuery, usePowerSyncQuery and usePowerSyncStatus hooks
  • Updated demos to use latest hooks

How to test

  • Load any of the demos and confirm that all items still load as expected

Note: The suspense and kysely hook changes will follow after this, and I will make a separate change for the Vue hooks so that they conform to this new change

Chriztiaan
Chriztiaan previously approved these changes Apr 29, 2024
Copy link
Collaborator

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to see other react hook results like isLoading or hasSynced being used in the demos and mentioned in the readme.

@DominicGBauer DominicGBauer requested a review from rkistner April 29, 2024 14:21
Copy link
Collaborator

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from my side

@DominicGBauer DominicGBauer merged commit d62f367 into main Apr 30, 2024
@DominicGBauer DominicGBauer deleted the feat/add-use-query-hook branch April 30, 2024 09:42
Copy link
Contributor

@rkistner rkistner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some issues when the query (or parameters) change:

  1. The query is not refreshed until another change notification is triggered.
  2. The watched table list is never not updated.

This is specifically noticeable on the "SQL Console" page of the react-supabase-todolist demo

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.

5 participants