Skip to content
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

invalidatesTags - minor improvement #4644

Open
croraf opened this issue Sep 28, 2024 · 1 comment · May be fixed by #4671
Open

invalidatesTags - minor improvement #4644

croraf opened this issue Sep 28, 2024 · 1 comment · May be fixed by #4671
Labels
enhancement New feature or request rtk-query

Comments

@croraf
Copy link
Contributor

croraf commented Sep 28, 2024

I want this logic in invalidatesTags:

invalidatesTags: (_, __, body) => {
        return body.meetingId ? ["Meetings", "Meeting Item"] : ["Meetings"];
      }

but maybe would be nice if in the returned array falsey values get ignored, so I could then write:

invalidatesTags: (_, __, body) => {
        return  ["Meetings", body.meetingId && "Meeting Item"]
      }

Or at least throw an error, because in this latter variant no error is thrown but the Meetings dont refresh.

P.S. I mean, I guess I can chain the returned array with .filter(i => i)

@phryneas phryneas added the enhancement New feature or request label Sep 28, 2024
@phryneas
Copy link
Member

That seems like a reasonable idea :)

PRs are welcome!

@FaberVitale FaberVitale moved this to Handpicked issues from popular repos in RomaJS Opensource Night - 2024 Oct 7, 2024
@pierroberto pierroberto linked a pull request Oct 19, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rtk-query
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants