From 8a5bba1da639355a25da8c279a9f1cf0a7300a9f Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 11 Apr 2021 22:30:41 +0900 Subject: Replace app state with Custom Hooks --- src/console/app/contexts.ts | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/console/app/contexts.ts (limited to 'src/console/app/contexts.ts') diff --git a/src/console/app/contexts.ts b/src/console/app/contexts.ts new file mode 100644 index 0000000..7e4f323 --- /dev/null +++ b/src/console/app/contexts.ts @@ -0,0 +1,9 @@ +import React from "react"; +import { State, defaultState } from "./recuer"; +import { AppAction } from "./actions"; + +export const AppStateContext = React.createContext(defaultState); + +export const AppDispatchContext = React.createContext< + (action: AppAction) => void +>(() => {}); -- cgit v1.2.3