https://dev.kronoz.win/r/marzneshin.git
| 1 |
03b3dbc |
Mardin |
2y ago |
import { createContext, useContext } from "react"; |
| 2 |
03b3dbc |
Mardin |
2y ago |
import { ServiceType } from "@marzneshin/features/services"; |
| 3 |
03b3dbc |
Mardin |
2y ago |
|
| 4 |
03b3dbc |
Mardin |
2y ago |
interface RouterServiceContextProps { |
| 5 |
03b3dbc |
Mardin |
2y ago |
service: ServiceType; |
| 6 |
03b3dbc |
Mardin |
2y ago |
} |
| 7 |
03b3dbc |
Mardin |
2y ago |
|
| 8 |
03b3dbc |
Mardin |
2y ago |
export const RouterServiceContext = createContext<RouterServiceContextProps | null>(null); |
| 9 |
03b3dbc |
Mardin |
2y ago |
|
| 10 |
03b3dbc |
Mardin |
2y ago |
export const useRouterServiceContext = () => { |
| 11 |
03b3dbc |
Mardin |
2y ago |
const ctx = useContext(RouterServiceContext); |
| 12 |
03b3dbc |
Mardin |
2y ago |
return ctx; |
| 13 |
03b3dbc |
Mardin |
2y ago |
}; |