From 3ca5db394aa42313697999693728978da360b50a Mon Sep 17 00:00:00 2001 From: James Collins Date: Tue, 21 Feb 2023 09:05:53 +1000 Subject: [PATCH] added signal --- resources/js/helpers/api.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/js/helpers/api.ts b/resources/js/helpers/api.ts index 1f6a9dc..dcb7e14 100644 --- a/resources/js/helpers/api.ts +++ b/resources/js/helpers/api.ts @@ -15,6 +15,7 @@ interface ApiOptions { method?: string; headers?: HeadersInit; body?: string | object; + signal?: AbortSignal | null; progress?: ApiProgressCallback; } @@ -64,6 +65,7 @@ export const api = { method: options.method || "GET", headers: options.headers, body: options.body, + signal: options.signal || null, }; let receivedData = false;