Skip to content

Commit 219ae85

Browse files
authored
[Runtime Patch] Add AbortSignal to fetchWithCache in ArtifactCacheTemplate interface (#17233)
[Runtime] Add AbortSignal to fetchWithCache in ArtifactCacheTemplate interface
1 parent 3a02309 commit 219ae85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web/src/artifact_cache.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ export interface ArtifactCacheTemplate {
4747
* return the actual data object rather than the request. There are two options:
4848
* 1. "json": returns equivalent to `fetch(url).json()`
4949
* 2. "arraybuffer": returns equivalent to `fetch(url).arraybuffer()`
50+
* @param signal: An optional AbortSignal allowing user to abort the fetching before its completion.
5051
* @return The data object (i.e. users do not need to call `.json()` or `.arraybuffer()`).
5152
*
5253
* @note This is an async function.
5354
*/
54-
fetchWithCache(url: string, storetype?: string): Promise<any>;
55+
fetchWithCache(url: string, storetype?: string, signal?: AbortSignal): Promise<any>;
5556

5657
/**
5758
* Fetch data from url and add into cache. If already exists in cache, should return instantly.

0 commit comments

Comments
 (0)