Skip to content

Commit f8ceee4

Browse files
committed
Use maps instead of weakmaps
Signed-off-by: Marcos Candeia <[email protected]>
1 parent eee3e2e commit f8ceee4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/fresh/middlewares/3_main.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { MiddlewareHandlerContext } from "$fresh/server.ts";
2+
import { tryOrDefault } from "deco/utils/object.ts";
23
import { DECO_MATCHER_HEADER_QS } from "../../../blocks/matcher.ts";
34
import { RequestState } from "../../../blocks/utils.tsx";
45
import { Context } from "../../../deco.ts";
@@ -10,7 +11,6 @@ import { DecoSiteState, DecoState } from "../../../types.ts";
1011
import { isAdminOrLocalhost } from "../../../utils/admin.ts";
1112
import { allowCorsFor, defaultHeaders } from "../../../utils/http.ts";
1213
import { formatLog } from "../../../utils/log.ts";
13-
import { tryOrDefault } from "deco/utils/object.ts";
1414

1515
export const DECO_SEGMENT = "deco_segment";
1616

@@ -128,7 +128,7 @@ export const handler = [
128128
status: undefined,
129129
};
130130
const state: Partial<RequestState> = ctx.state?.$live?.state ?? {};
131-
const stateBag = new WeakMap();
131+
const stateBag = new Map();
132132
state.response = response;
133133
state.bag = stateBag;
134134
state.flags = [];

0 commit comments

Comments
 (0)