Skip to content

RTQ: How to unsubscribe from a useLazyQuery  #2055

@nichita-pasecinic

Description

@nichita-pasecinic

Hello 👋

In documentation https://redux-toolkit.js.org/rtk-query/usage/usage-without-react-hooks#removing-a-subscription
is specified a different way of subscription - un-subscription method for a query, but how to we do it with a hook ?

const [trigger, { data }] = useLazyEnpointQuery();

I cant pass a skip property to useLazyQuery that forces the unsubscription from the query, it can be used only with the useQuery hook. So how can I unsubscribe from a lazy query ?

Thanks for help!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions