Skip to content

Support suspense in React #692

@MAST1999

Description

@MAST1999

Current Situation
Right now, there is no way to handle the data loading aspect of useLiveQuery with Suspense in React or any other integrations as far as I could tell.

Expected behavior
We should be able to opt into suspense or have a new hook called useLiveSuspenseQuery like tanstack/query.

Additional context
This was requested in this discord chat, and I've also encountered the need to do this.

Implementation
I've done a rough implementation on top of the current useLiveQuery here which I don't think is ideal, but I've hit a blocker.

The use(collection.preload()) promise is never resolving, or it's not correctly notified. I can't figure it out right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions