Manual Abort
Start a slow request (3s delay) and cancel it before it completes.
ts
const controller = new AbortController()
// Pass signal via .with() to cancel the request at any time
const promise = caller.misc.with({ signal: controller.signal }).slow()
// Cancel the request
controller.abort()caller.misc.with({ signal }).slow()SANDBOX
// run the request to see the responseRequest Deduplication
Click the button rapidly — each click aborts the previous in-flight request. Only the last request completes.
ts
const abortRef = useRef<AbortController | null>(null)
function handleClick() {
// Abort the previous in-flight request
abortRef.current?.abort()
const controller = new AbortController()
abortRef.current = controller
caller.users.with({ signal: controller.signal }).getAll()
}caller.users.with({ signal }).getAll()SANDBOX
// run the request to see the responsededuplicate — HttpClient-Level Dedup
Source-level config that auto-aborts duplicate requests by path+method. Used in direct mode or persistent HttpClient scenarios.
ts
import { defineApi } from "@noverax/courier/define"
// deduplicate: true enables automatic deduplication
// at the HttpClient level — if the same path+method is called
// again while a request is in-flight, the old one is aborted
// with a 499 status code.
const api = defineApi({
baseURL: "http://localhost:4000",
groups,
deduplicate: true,
})When deduplicate: true is set, the HttpClient tracks in-flight requests by path and method. If a duplicate is fired, the previous one is aborted with status 499.