1
0
Fork 0
VaultUI/src/playground.tsx

25 lines
697 B
TypeScript
Raw Normal View History

2021-05-16 10:27:21 +01:00
import { PageRouter } from "z-pagerouter";
2021-05-10 11:35:14 +01:00
import { PageState } from "./PageState";
import i18next from "i18next";
// Playground is a way to debug and test things.
// Anything you put in here is gonna be run on page initial load
// before rendering.
// Also it only runs when process.env.NODE_ENV == "development"
2021-05-10 11:35:14 +01:00
declare global {
interface Window {
pageState: PageState;
i18next: unknown;
router: PageRouter;
}
2021-05-10 11:35:14 +01:00
}
// Please empty this function before committing.
export async function playground(router: PageRouter): Promise<void> {
console.log("Welcome to Playground!");
2021-05-16 09:42:43 +01:00
window.pageState = router.state as PageState;
2021-05-10 11:35:14 +01:00
window.i18next = i18next;
window.router = router;
}