plane/web/hooks/store/use-inbox-issues.ts
sriram veeraghanta 3d09a69d58
fix: eslint issues and reconfiguring (#3891)
* fix: eslint fixes

---------

Co-authored-by: gurusainath <gurusainath007@gmail.com>
2024-03-06 18:39:14 +05:30

16 lines
558 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 };
};