mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-01 13:27:08 +02:00
big work
This commit is contained in:
@@ -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),
|
||||
};
|
||||
Reference in New Issue
Block a user