diff options
author | Florian Dold <florian@dold.me> | 2022-04-12 12:54:57 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-04-12 12:55:32 +0200 |
commit | 1e92093a50962f4702339e872caa4f82af90af70 (patch) | |
tree | 10d927c7e51e8fd1cf52629dd3d19d3fbd28b1bf /packages/anastasis-webui/src/context/anastasis.ts | |
parent | afecab8000fa59475fe02a402176789e360651ba (diff) | |
download | wallet-core-1e92093a50962f4702339e872caa4f82af90af70.tar.gz wallet-core-1e92093a50962f4702339e872caa4f82af90af70.tar.bz2 wallet-core-1e92093a50962f4702339e872caa4f82af90af70.zip |
anastasis: discovery
Diffstat (limited to 'packages/anastasis-webui/src/context/anastasis.ts')
-rw-r--r-- | packages/anastasis-webui/src/context/anastasis.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/anastasis-webui/src/context/anastasis.ts b/packages/anastasis-webui/src/context/anastasis.ts index c2e7b2a47..40d25d144 100644 --- a/packages/anastasis-webui/src/context/anastasis.ts +++ b/packages/anastasis-webui/src/context/anastasis.ts @@ -23,11 +23,9 @@ import { createContext, h, VNode } from "preact"; import { useContext } from "preact/hooks"; import { AnastasisReducerApi } from "../hooks/use-anastasis-reducer"; -type Type = AnastasisReducerApi | undefined; - const initial = undefined; -const Context = createContext<Type>(initial); +const Context = createContext<AnastasisReducerApi | undefined>(initial); interface Props { value: AnastasisReducerApi; @@ -38,4 +36,5 @@ export const AnastasisProvider = ({ value, children }: Props): VNode => { return h(Context.Provider, { value, children }); }; -export const useAnastasisContext = (): Type => useContext(Context); +export const useAnastasisContext = (): AnastasisReducerApi | undefined => + useContext(Context); |