diff options
author | Nate Sesti <33237525+sestinj@users.noreply.github.com> | 2023-08-06 22:54:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-06 22:54:51 -0700 |
commit | 74005855304412f0401e29c83c166e99a8ab0944 (patch) | |
tree | 4e8ddb61fd52068e839ca4ccab268e013405d545 /extension/react-app/src/redux/hooks.ts | |
parent | a0d3f29ee237484c66b0efe243c79d902f2da993 (diff) | |
parent | 8ada89b0f66f9e746394ee64591359537fe0c7f0 (diff) | |
download | sncontinue-74005855304412f0401e29c83c166e99a8ab0944.tar.gz sncontinue-74005855304412f0401e29c83c166e99a8ab0944.tar.bz2 sncontinue-74005855304412f0401e29c83c166e99a8ab0944.zip |
Merge pull request #351 from continuedev/history
Session History
Diffstat (limited to 'extension/react-app/src/redux/hooks.ts')
-rw-r--r-- | extension/react-app/src/redux/hooks.ts | 21 |
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]; -} |