Examples using hmm-api (frontend)
1. Using sonner, shadcn
import ApiClient from "hmm-api"; // import hmm-api
import { toast } from "sonner" or import { toast } from "@/hooks/use-toast";; // import toast
export const api = new ApiClient({
toast,
parseErrorResponse: (err) => {
// parse err according to your err response from server
return { message: err?.message || "something went wrong" };
},
});
- Others
coming soon // (you can also contribute or provide feedback)