Skip to content

Commit

Permalink
Remove an unecessary ref
Browse files Browse the repository at this point in the history
  • Loading branch information
sisou committed Aug 30, 2023
1 parent 59d9fb2 commit 1cd0d82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stores/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Map<number, MemoizedCluster[]>>(new Map())
const memoizedClusters = new Map<number, MemoizedCluster[]>()

const clusterAlgorithm = shallowRef<Supercluster>()

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())
Expand Down Expand Up @@ -84,7 +84,7 @@ export const useCluster = defineStore('cluster', () => {
existingData.push(newMemoizedData)

else
memoizedCluster.value.set(zoom, [newMemoizedData])
memoizedClusters.set(zoom, [newMemoizedData])
}

return {
Expand Down

0 comments on commit 1cd0d82

Please sign in to comment.