summaryrefslogtreecommitdiff
path: root/extension/react-app/src/redux/hooks.ts
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-08-06 22:51:10 -0700
committerNate Sesti <sestinj@gmail.com>2023-08-06 22:51:10 -0700
commit6bce4b2802d06818f33b260ca4353331ea4b2df9 (patch)
tree1aafefb3645707b8fdebe5d8acee7c94eebda041 /extension/react-app/src/redux/hooks.ts
parentf96eecb0a531eaef86a503c216882f196ed9299e (diff)
downloadsncontinue-6bce4b2802d06818f33b260ca4353331ea4b2df9.tar.gz
sncontinue-6bce4b2802d06818f33b260ca4353331ea4b2df9.tar.bz2
sncontinue-6bce4b2802d06818f33b260ca4353331ea4b2df9.zip
refactor: :recycle: hoist FullState up to redux
Diffstat (limited to 'extension/react-app/src/redux/hooks.ts')
-rw-r--r--extension/react-app/src/redux/hooks.ts21
1 files changed, 0 insertions, 21 deletions
diff --git a/extension/react-app/src/redux/hooks.ts b/extension/react-app/src/redux/hooks.ts
deleted file mode 100644
index a6aef869..00000000
--- a/extension/react-app/src/redux/hooks.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { useCallback } from "react";
-import { useDispatch, useSelector } from "react-redux";
-import { RootStore } from "./store";
-import { selectDebugContextValue } from "./selectors/debugContextSelectors";
-import { updateValue } from "./slices/debugContexSlice";
-import { SerializedDebugContext } from "../../../src/client";
-
-export function useDebugContextValue(
- key: keyof SerializedDebugContext,
- defaultValue: any
-): [any, (value: any) => void] {
- const dispatch = useDispatch();
- const state =
- useSelector((state: RootStore) => selectDebugContextValue(state, key)) ||
- defaultValue;
- const boundAction = useCallback(
- (value: any) => dispatch(updateValue({ key, value })),
- [dispatch, key]
- );
- return [state, boundAction];
-}