gitscope
← marzneshin / v0.3.2 / dashboard/src/features/services/router-context/index.ts
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/features/services/router-context/index.ts · TypeScript
Blame Raw
 1import { createContext, useContext } from "react";
 2import { ServiceType } from "@marzneshin/features/services";
 3
 4interface RouterServiceContextProps {
 5    service: ServiceType;
 6}
 7
 8export const RouterServiceContext = createContext<RouterServiceContextProps | null>(null);
 9
10export const useRouterServiceContext = () => {
11    const ctx = useContext(RouterServiceContext);
12    return ctx;
13};