mirror of
https://github.com/aykhans/slash-e.git
synced 2026-08-08 08:27:31 +00:00
19 lines
398 B
TypeScript
19 lines
398 B
TypeScript
import { createContext, useContext } from "react";
|
|
|
|
interface Context {
|
|
instanceUrl?: string;
|
|
setInstanceUrl: (instanceUrl: string) => void;
|
|
}
|
|
|
|
export const StorageContext = createContext<Context>({
|
|
instanceUrl: undefined,
|
|
setInstanceUrl: () => {},
|
|
});
|
|
|
|
const useStorageContext = () => {
|
|
const context = useContext(StorageContext);
|
|
return context;
|
|
};
|
|
|
|
export default useStorageContext;
|