From c5cf3d169a1612e22ef5d39157d501bdd0d1b922 Mon Sep 17 00:00:00 2001 From: SimonShiki Date: Tue, 26 Nov 2024 14:33:39 +0800 Subject: [PATCH] :bug: fix: type errors Signed-off-by: SimonShiki --- src/main/trap/redux.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/trap/redux.ts b/src/main/trap/redux.ts index b2a0b33..35bcb8d 100644 --- a/src/main/trap/redux.ts +++ b/src/main/trap/redux.ts @@ -2,7 +2,7 @@ import log from '../util/console'; export interface EuRedux { target: EventTarget; - state: DucktypedState; + state: Partial; dispatch(action: DucktypedAction): unknown; } @@ -92,14 +92,14 @@ export function getRedux (): Promise { function middleware ({ getState, dispatch }: MiddlewareAPI) { const euRedux = trappedRedux as EuRedux; - euRedux.dispatch = dispatch; - euRedux.state = getState(); + euRedux.dispatch = dispatch as (action: DucktypedAction) => unknown; + euRedux.state = getState() as Partial; return (next: (action: A) => void) => (action: A) => { const nextReturn = next(action); const ev = new CustomEvent('statechanged', { detail: { prev: euRedux.state, - next: (euRedux.state = getState()), + next: (euRedux.state = getState() as Partial), action, }, });