Skip to content

Commit

Permalink
Use maps instead of weakmaps
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Candeia <[email protected]>
  • Loading branch information
mcandeia committed Mar 13, 2024
1 parent 1a6d3b5 commit 06446f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/fresh/middlewares/3_main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MiddlewareHandlerContext } from "$fresh/server.ts";
import { tryOrDefault } from "deco/utils/object.ts";
import { DECO_MATCHER_HEADER_QS } from "../../../blocks/matcher.ts";
import { RequestState } from "../../../blocks/utils.tsx";
import { Context } from "../../../deco.ts";
Expand All @@ -10,7 +11,6 @@ import { DecoSiteState, DecoState } from "../../../types.ts";
import { isAdminOrLocalhost } from "../../../utils/admin.ts";
import { allowCorsFor, defaultHeaders } from "../../../utils/http.ts";
import { formatLog } from "../../../utils/log.ts";
import { tryOrDefault } from "deco/utils/object.ts";

export const DECO_SEGMENT = "deco_segment";

Expand Down Expand Up @@ -128,7 +128,7 @@ export const handler = [
status: undefined,
};
const state: Partial<RequestState> = ctx.state?.$live?.state ?? {};
const stateBag = new WeakMap();
const stateBag = new Map();
state.response = response;
state.bag = stateBag;
state.flags = [];
Expand Down

0 comments on commit 06446f2

Please sign in to comment.