Factory that creates a reusable mutation hook pre-bound to an engine, method, and path.
const useCreateUser = createMutation<User>(api, 'post', '/users', { emitOnSuccess: 'users.created', }, observer); // In any component: const { mutate, loading } = useCreateUser();
FetchEngine instance
HTTP method (post, put, delete, patch)
Request path
Optional
Default mutation options
Optional ObserverEngine for emitOnSuccess
Factory that creates a reusable mutation hook pre-bound to an engine, method, and path.