Skip to content

Commit

Permalink
🐛 fix: type errors
Browse files Browse the repository at this point in the history
Signed-off-by: SimonShiki <[email protected]>
  • Loading branch information
SimonShiki committed Nov 26, 2024
1 parent c9df304 commit c5cf3d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/trap/redux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import log from '../util/console';

export interface EuRedux {
target: EventTarget;
state: DucktypedState;
state: Partial<DucktypedState>;
dispatch(action: DucktypedAction): unknown;
}

Expand Down Expand Up @@ -92,14 +92,14 @@ export function getRedux (): Promise<EuRedux> {

function middleware ({ getState, dispatch }: MiddlewareAPI<S, A>) {
const euRedux = trappedRedux as EuRedux;
euRedux.dispatch = dispatch;
euRedux.state = getState();
euRedux.dispatch = dispatch as (action: DucktypedAction) => unknown;
euRedux.state = getState() as Partial<DucktypedState>;
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<DucktypedState>),
action,
},
});
Expand Down

0 comments on commit c5cf3d1

Please sign in to comment.