File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -14,17 +14,24 @@ export interface AbortError {
1414
1515export type FetchError = NetworkError | AbortError ;
1616
17+ /**
18+ * Represents a function that performs a network request using the Fetch API.
19+ *
20+ * @param input - The resource URL or a {@linkcode Request} object.
21+ * @param init - An optional object containing request options.
22+ * @returns A promise that resolves to a {@linkcode Result} object containing either a {@linkcode Request} or an error.
23+ */
1724export type RobustFetch = (
1825 input : RequestInfo | URL ,
1926 init ?: RequestInit ,
2027) => Promise < Result < Response , FetchError > > ;
2128
2229/**
23- * Performs a network request using the Fetch API .
30+ * A simple implementation of { @linkcode RobustFetch} that uses { @linkcode fetch} .
2431 *
25- * @param input - The resource URL or a ` Request` object.
32+ * @param input - The resource URL or a { @linkcode Request} object.
2633 * @param init - An optional object containing request options.
27- * @returns A promise that resolves to a ` Result` object containing either a `Response` or an error.
34+ * @returns A promise that resolves to a { @linkcode Result} object containing either a { @linkcode Request} or an error.
2835 */
2936export const robustFetch : RobustFetch = async ( input , init ) => {
3037 const request = new Request ( input , init ) ;
You can’t perform that action at this time.
0 commit comments