Skip to content

Wiring up abort controller on RTKQ #2048

Answered by phryneas
checkDaResume asked this question in Q&A
Discussion options

You must be logged in to vote

signal is already passed in - and you should not tinker with that. You can call .cancel() on your submitted query, but not add a new signal overriding the internal one.

Realistically I think it's the wrong tool for what you are doing here tbh. Because at that point the request is pretty much already done.

If you want to instantly return an error when there is no token in state yet, then better wrap your baseQuery and just return an early error there.

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
8 replies
@phryneas
Comment options

@checkDaResume
Comment options

@checkDaResume
Comment options

@phryneas
Comment options

@checkDaResume
Comment options

Answer selected by checkDaResume
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants