plane/web/core/hooks/use-issue-layout-store.ts
2024-06-13 21:17:06 +05:30

18 lines
480 B
TypeScript

import { createContext, useContext } from "react";
import { EIssuesStoreType } from "@/constants/issue";
import { useIssues } from "./store";
export const IssuesStoreContext = createContext<EIssuesStoreType>(EIssuesStoreType.PROJECT);
export const useIssueStoreType = () => {
const storeType = useContext(IssuesStoreContext);
return storeType;
};
export const useIssuesStore = () => {
const storeType = useContext(IssuesStoreContext);
return useIssues(storeType);
};