Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Oct 27, 2024
1 parent 7f1866d commit 20187d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/workerd/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import {
DevEnvironment,
type HotChannel,
type HotPayload,
type Plugin,
type ResolvedConfig,
} from "vite";
Expand Down Expand Up @@ -108,7 +109,7 @@ export async function createWorkerdDevEnvironment(
}
},
__viteRunnerSend: async (request) => {
const payload = await request.json();
const payload = (await request.json()) as HotPayload;
hotListener.dispatch(payload);
return MiniflareResponse.json(null);
},
Expand Down Expand Up @@ -206,7 +207,7 @@ export async function createWorkerdDevEnvironment(

// wrapper to simplify listener management
function createHotListenerManager(): Pick<HotChannel, "on" | "off"> & {
dispatch: (payload: any) => void;
dispatch: (payload: HotPayload) => void;
} {
const listerMap: Record<string, Set<Function>> = {};
const getListerMap = (e: string) => (listerMap[e] ??= new Set());
Expand Down

0 comments on commit 20187d5

Please sign in to comment.