The mergeFetchHooks function is a utility function that merges multiple fetch hooks into a single fetch hook.
This utility is useful when you need to combine fetch hooks from different sources, such as global hooks, module-specific hooks, and user-defined hooks.
const hooks1 = {
onRequest: (ctx) => console.log('Global request hook'),
onResponse: (ctx) => console.log('Global response hook')
};
const hooks2 = {
onRequest: (ctx) => console.log('Module request hook'),
onResponseError: (ctx) => console.error('Module error hook')
};
const merged = mergeFetchHooks(hooks1, hooks2);
// Result will have both onRequest hooks and both error handling hooks
function mergeFetchHooks(...hooks: FetchHooks[]): FetchHooks