Skip to content

useQuery: ability to skip the query when needed #22

@sazzad-sat

Description

@sazzad-sat

It would be awesome if there is an option to skip query, like the convex/react way. Currently it is achievable using the following:

const query = $derived(skip && useQuery(api.posts.get, () => someArgs));

But this is cleaner in terms of dx:

const query = useQuery(api.posts.get, () => someArgs, { skip });

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