otterscan/src/useAppConfig.ts
2022-08-31 17:38:37 -03:00

14 lines
393 B
TypeScript

import React, { useContext } from "react";
import { SourcifySource } from "./sourcify/useSourcify";
export type AppConfig = {
sourcifySource: SourcifySource;
setSourcifySource: (newSourcifySource: SourcifySource) => void;
};
export const AppConfigContext = React.createContext<AppConfig>(undefined!);
export const useAppConfigContext = () => {
return useContext(AppConfigContext);
};