diff --git a/modern/src/index.js b/modern/src/index.js index 96b217bf..82af9da9 100644 --- a/modern/src/index.js +++ b/modern/src/index.js @@ -1,10 +1,16 @@ import React from "react"; import ReactDOM from "react-dom"; +import { Provider } from "react-redux"; import "./index.css"; import App from "./App"; import Debugger from "./debugger"; +import { create } from "./store"; + +const store = create(); ReactDOM.render( - window.location.pathname === "/debugger" ? : , + + {window.location.pathname === "/debugger" ? : } + , document.getElementById("root") ); diff --git a/modern/src/store.ts b/modern/src/store.ts new file mode 100644 index 00000000..9c4584e9 --- /dev/null +++ b/modern/src/store.ts @@ -0,0 +1,18 @@ +import { ModernAppState, ModernAction } from "./types"; +import { createStore } from "redux"; + +const defaultState = {}; + +function reducer( + state: ModernAppState = defaultState, + action: ModernAction +): ModernAppState { + switch (action.type) { + default: + return state; + } +} + +export function create() { + return createStore(reducer); +} diff --git a/modern/src/types.ts b/modern/src/types.ts new file mode 100644 index 00000000..6eb3f2dd --- /dev/null +++ b/modern/src/types.ts @@ -0,0 +1,2 @@ +export type ModernAppState = {}; +export type ModernAction = { type: "INIT" };