plane/web/hooks/store/estimates/use-project-estimate.ts

13 lines
442 B
TypeScript
Raw Normal View History

2024-05-23 08:11:30 +00:00
import { useContext } from "react";
// context
import { StoreContext } from "@/lib/store-context";
// mobx store
import { IProjectEstimateStore } from "@/store/estimates/project-estimate.store";
export const useProjectEstimates = (): IProjectEstimateStore => {
2024-05-23 08:11:30 +00:00
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useProjectPage must be used within StoreProvider");
return context.projectEstimate;
};