This commit is contained in:
Olivier Gagnon
2021-09-17 19:43:08 -04:00
parent 1344a17482
commit 45f2f85a30
58 changed files with 1738 additions and 2307 deletions
+19
View File
@@ -0,0 +1,19 @@
import React, { useContext } from "react";
import { IPlayer } from "../PersonObjects/IPlayer";
import { IRouter } from "./Router";
export const Context: {
Player: React.Context<IPlayer>;
Router: React.Context<IRouter>;
} = {
Player: React.createContext<IPlayer>({} as IPlayer),
Router: React.createContext<IRouter>({} as IRouter),
};
export const use: {
Player: () => IPlayer;
Router: () => IRouter;
} = {
Player: () => useContext(Context.Player),
Router: () => useContext(Context.Router),
};