From 1cd0d82599f6f16b2cdabb0a5d6ebdf01f41d67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren?= Date: Wed, 30 Aug 2023 13:43:37 +0200 Subject: [PATCH] Remove an unecessary ref --- src/stores/cluster.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stores/cluster.ts b/src/stores/cluster.ts index 23a23f21..423f6b65 100644 --- a/src/stores/cluster.ts +++ b/src/stores/cluster.ts @@ -26,12 +26,12 @@ export const useCluster = defineStore('cluster', () => { - Before re-clustering, we check for existing data matching the current zoom, bounding box, and filters. - If a match is found, we reuse stored clusters; otherwise, new clusters are computed and stored. */ - const memoizedCluster = shallowRef>(new Map()) + const memoizedClusters = new Map() const clusterAlgorithm = shallowRef() function cluster(locations: Location[], { neLat, neLng, swLat, swLng }: BoundingBox, zoom: number) { - const existingData = memoizedCluster.value.get(zoom) + const existingData = memoizedClusters.get(zoom) if (existingData) { const toStr = (arr: string[]) => JSON.stringify(arr.sort()) @@ -84,7 +84,7 @@ export const useCluster = defineStore('cluster', () => { existingData.push(newMemoizedData) else - memoizedCluster.value.set(zoom, [newMemoizedData]) + memoizedClusters.set(zoom, [newMemoizedData]) } return {