plane/web/core/hooks/use-issue-layout-store.ts
2024-06-11 14:39:52 +05:30

18 lines
480 B
TypeScript

import { EIssuesStoreType } from "@/constants/issue";
import { createContext, useContext } from "react";
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);
};