Skip to content

RTKQ: Get loading state of a single mutation in different components #1513

@EliseyMartynov

Description

@EliseyMartynov

Hello! I've a following problem:

  • Imagine we have some POST mutation hook to an endpoint in a X component that's inside Y component.
  • The problem: I can get a loading state of the mutation in X - where it has been called - but I can't access this loading state in Y. That's feeling like a really disadvantage because it's a really regular case when you need to get a loading state of a single mutation in different components.
  • I've already read that a mutation is unique and doesn't share data between different components. But there is no solution for that regular case? I know we can store some loading field in Redux and dispatch it in a mutation but... hey, I go for RTKQ because I don't want any loading fields in my Redux.

Thank you in advance! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions