Creates a timeout middleware for the @cleverbrush/web client.
@cleverbrush/web
If the request does not complete within the configured duration, the request is aborted and a TimeoutError is thrown.
Timeout configuration.
A Middleware that enforces request timeouts.
// 5 second timeout:const client = createClient(api, { middlewares: [timeout({ timeout: 5000 })],}); Copy
// 5 second timeout:const client = createClient(api, { middlewares: [timeout({ timeout: 5000 })],});
Creates a timeout middleware for the
@cleverbrush/webclient.If the request does not complete within the configured duration, the request is aborted and a TimeoutError is thrown.