Skip to content
Discussion options

You must be logged in to vote

In 1.169.3, next({ signal }) isn't part of the supported middleware API. The types for that release don't expose a signal option on next.

For a server-function call, you can pass it at the call site:

const controller = new AbortController()

const result = await myServerFn({
  // data: ...,
  signal: controller.signal,
})

// Call controller.abort() from your cancellation handler.

That's supported by FetcherBaseOptions.

If you want to configure the outgoing RPC request centrally, client function middleware supports next({ fetch: customFetch }). You can customize the fetch options there; preserve any existing signal if you're combining it with a timeout. See the middleware documentation.

F…

Replies: 1 comment

Comment options

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