File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -475,6 +475,19 @@ export default class HttpClient {
475475 }
476476 }
477477
478+ /**
479+ * Specify the timeout (in milliseconds) for the pending request.
480+ *
481+ * @param {number } milliseconds
482+ *
483+ * @returns {this }
484+ */
485+ public timeout ( milliseconds : number ) : this {
486+ this . withOption ( 'signal' , AbortSignal . timeout ( milliseconds ) ) ;
487+
488+ return this ;
489+ }
490+
478491 /**
479492 * Specify the basic authentication username and password for the request.
480493 *
Original file line number Diff line number Diff line change @@ -4,5 +4,6 @@ export type Options = {
44 body ?: FormData | string | URLSearchParams ;
55 credentials ?: RequestCredentials ;
66 headers ?: Headers ;
7+ signal ?: AbortSignal ;
78 [ key : string ] : RequestOptions ;
89} ;
You can’t perform that action at this time.
0 commit comments