Skip to content

Commit ca9bc0c

Browse files
try without CancelablePromise
1 parent d250fcb commit ca9bc0c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/orkes/request/request.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ const sendRequest = async (
213213
body: any,
214214
formData: FormData | undefined,
215215
headers: Headers,
216-
onCancel: OnCancel,
216+
//onCancel: OnCancel,
217217
fetchFn: FetchFn<RequestInit, Response> = fetch
218218
): Promise<Response> => {
219219
//const controller = new AbortController();
@@ -225,7 +225,7 @@ const sendRequest = async (
225225
//signal: controller.signal as AbortSignal,
226226
};
227227

228-
onCancel(() => console.log("Aborting request")); //controller.abort());
228+
//onCancel(() => console.log("Aborting request")); //controller.abort());
229229

230230
return await fetchFn(url, request);
231231
};
@@ -298,8 +298,8 @@ export const request = <T>(
298298
config: OpenAPIConfig,
299299
options: ApiRequestOptions,
300300
fetchFn: FetchFn = fetch
301-
): CancelablePromise<T> => {
302-
return new CancelablePromise(async (resolve, reject, onCancel) => {
301+
): Promise<T> => { //CancelablePromise<T> => {
302+
return new Promise(async (resolve, reject) => {//return new CancelablePromise(async (resolve, reject, onCancel) => {
303303
try {
304304
const url = getUrl(config, options);
305305
const formData = getFormData(options);
@@ -313,7 +313,7 @@ export const request = <T>(
313313
body,
314314
formData,
315315
headers,
316-
onCancel,
316+
//onCancel,
317317
fetchFn
318318
);
319319
const responseBody = await getResponseBody(response);

0 commit comments

Comments
 (0)