Add display loading state when updating item

This commit is contained in:
Prayag Prajapati committed 2023-08-27 23:44:43 +05:30
1 parent 38a7369650
commit 7df0f3f9d3
8 files changed
+231 -39

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
/** @format */
import { create } from "zustand";
export const useAppLoadingStore = create((set) => ({
isLoading: false,
isSuccess: false,
isError: false,
setIsLoading: (loading) =>
set((state) => ({ ...state, isLoading: loading })),
setIsSuccess: (success) =>
set((state) => ({ ...state, isSuccess: success })),
setIsError: (error) => set((state) => ({ ...state, isError: error })),
}));