[st] feat: 입력 - 제출 시 imr 요청 및 상태 확인, 진행 progress bar 추가
This commit is contained in:
@@ -2,6 +2,7 @@ export { getCookie, setCookie, removeCookie } from "./cookie";
|
||||
export { useMutationWrapper } from "./use-mutation-wrapper";
|
||||
export { useAlertStore } from "./use-alert-store";
|
||||
export { useDataTable } from "./use-data-table";
|
||||
export { useGlobalProgressStore } from "./use-global-progress-store";
|
||||
export { useMenuStore } from "./use-menu-store";
|
||||
export { useUserStore } from "./use-user-store";
|
||||
export { usePrompt } from "./use-prompt";
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { useContext } from "react";
|
||||
import { useStore } from "zustand";
|
||||
import type { GlobalProgressStore } from "../store/global-progress-store";
|
||||
import { StoreContext } from "../providers/store-provider";
|
||||
|
||||
export const useGlobalProgressStore = <T>(
|
||||
selector: (store: GlobalProgressStore) => T,
|
||||
): T => {
|
||||
const storeContext = useContext(StoreContext);
|
||||
|
||||
if (!storeContext) {
|
||||
throw new Error("useGlobalProgressStore must be used within StoreProvider");
|
||||
}
|
||||
|
||||
return useStore(storeContext.globalProgressStore, selector);
|
||||
};
|
||||
Reference in New Issue
Block a user