chore(eslint): fix react-query cancelable promise type

This commit is contained in:
Paul Chavard 2022-02-23 13:08:31 +01:00 committed by Pierre de La Morinerie
parent a914950982
commit 4e218ba562

View file

@ -70,8 +70,9 @@ const defaultQueryFn: QueryFunction<unknown, QueryKey> = async ({
}
throw new Error(`Error fetching from "${scope}" API`);
});
(promise as any).cancel = () => controller && controller.abort();
return promise;
return Object.assign(promise, {
cancel: () => controller && controller.abort()
});
};
let paysCache: { label: string }[];