Creates a set of API hooks pre-bound to a FetchEngine and optional ObserverEngine.
Returns { useQuery, useMutation, useAsync, createQuery, createMutation } with
the engine and observer already wired in.
const api = new FetchEngine({ baseUrl: '/api' });
const events = new ObserverEngine<AppEvents>();
const { useQuery, useMutation, createQuery } = createApiHooks(api, events);
// In components — no need to pass engine/observer:
const { data } = useQuery<User[]>('/users');
const { mutate } = useMutation<User>('post', '/users');
Creates a set of API hooks pre-bound to a FetchEngine and optional ObserverEngine. Returns
{ useQuery, useMutation, useAsync, createQuery, createMutation }with the engine and observer already wired in.