From e652b8ef4423c1375f4e17ba7193018350854877 Mon Sep 17 00:00:00 2001 From: Claas Date: Sun, 2 Jun 2024 15:38:48 +0200 Subject: [PATCH] Remove type because it is dependent on implementation and updating both when having to make updates is unnecessary as it is also the only place where it is used. The implementation defines the type --- src/AppContext.tsx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/AppContext.tsx b/src/AppContext.tsx index 1a4fc77..df7f967 100644 --- a/src/AppContext.tsx +++ b/src/AppContext.tsx @@ -59,15 +59,6 @@ createEffect((previous) => { return newSocket; }, socket()); -type AppState = { - identity: Resource; - setIdentity: Setter; - socket: Accessor; - groups: Resource; - setGroups: Setter; - messages: Record; -}; - const state = { identity, setIdentity, @@ -75,7 +66,9 @@ const state = { groups, setGroups, messages, -} satisfies AppState; + setMessages, +}; + const AppContext = createContext(state); export function SocketProvider(properties: { children: JSX.Element }) { -- 2.51.2