From 1e92597c16a3225afcccee77638f05bf93b4cb29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Muzyk?= Date: Wed, 1 Apr 2026 12:17:47 +0200 Subject: [PATCH] perf: Change to WeakMap to selectors can be GCed --- lib/OnyxSnapshotCache.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OnyxSnapshotCache.ts b/lib/OnyxSnapshotCache.ts index 49ce6a0c3..3d96cc858 100644 --- a/lib/OnyxSnapshotCache.ts +++ b/lib/OnyxSnapshotCache.ts @@ -33,7 +33,7 @@ class OnyxSnapshotCache { constructor() { this.snapshotCache = new Map(); - this.selectorIDMap = new Map(); + this.selectorIDMap = new WeakMap(); this.selectorIDCounter = 0; this.cacheKeyRefCounts = new Map(); }