mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
16 lines
564 B
TypeScript
16 lines
564 B
TypeScript
import { useContext } from "react";
|
|
// mobx store
|
|
import { StoreContext } from "@/contexts/store-context";
|
|
// types
|
|
import { IInboxFilter } from "@/store/inbox/inbox_filter.store";
|
|
import { IInboxIssue } from "@/store/inbox/inbox_issue.store";
|
|
|
|
export const useInboxIssues = (): {
|
|
issues: IInboxIssue;
|
|
filters: IInboxFilter;
|
|
} => {
|
|
const context = useContext(StoreContext);
|
|
if (context === undefined) throw new Error("useInboxIssues must be used within StoreProvider");
|
|
return { issues: context.inbox.inboxIssue, filters: context.inbox.inboxFilter };
|
|
};
|