Add a basic React implementation of the map.

See client/README.md for instructions.
This commit is contained in:
Dan Albert
2022-02-26 14:15:39 -08:00
parent 4e348dd99a
commit 59e98b31df
32 changed files with 30095 additions and 12 deletions

6
client/src/app/hooks.ts Normal file
View File

@@ -0,0 +1,6 @@
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
import type { RootState, AppDispatch } from "./store";
// Use throughout your app instead of plain `useDispatch` and `useSelector`
export const useAppDispatch = () => useDispatch<AppDispatch>();
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;

17
client/src/app/store.ts Normal file
View File

@@ -0,0 +1,17 @@
import { configureStore, ThunkAction, Action } from "@reduxjs/toolkit";
import theaterReducer from "../game/theater/theaterSlice";
export const store = configureStore({
reducer: {
theater: theaterReducer,
},
});
export type AppDispatch = typeof store.dispatch;
export type RootState = ReturnType<typeof store.getState>;
export type AppThunk<ReturnType = void> = ThunkAction<
ReturnType,
RootState,
unknown,
Action<string>
>;