A utility function for making API requests.

import { fetcher } from 'react-query-manager';

fetcher({
url: 'https://jsonplaceholder.typicode.com/todos/1',
method: 'GET',
onSuccess: (data, args, context) => {
console.log(data);
console.log(args);
console.log(context);
},
onError: (error, args, context) => {
console.error(error);
console.error(args);
console.error(context);
},
context: { value: '1' }
});