-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
export const api = createApi({
reducerPath: 'apiCache',
baseQuery: fetchBaseQuery({ baseUrl: '/api/v1', timeout: 5000 }),
endpoints: (builder) => ({
getData: builder.query<string, void>({
query: () => ({ url: '/data/' }),
}),
}),
});
const Component: FC = () => {
const abortRef = useRef<() => void>();
const [trigger] = useLazyGetDataQuery();
return (
<div>
<input
onChange={() => {
abortRef.current?.();
const result = trigger();
abortRef.current = () => {
result.abort();
};
}}
/>
</div>
);
};
when I pass a timeout option to fetchBaseQuery, the abort() function returned by a lazy query stops working and throws the following error:

Without timeout everything works as intended
Metadata
Metadata
Assignees
Labels
No labels