From 586f4c2bfeb2c886e367d98ab4a3721274caab91 Mon Sep 17 00:00:00 2001 From: Adam Horodyski Date: Tue, 10 Dec 2024 15:22:13 +0100 Subject: [PATCH] fix: remove the in-memory set for decorated aliases to allow react integration --- lib/metrics.ts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/metrics.ts b/lib/metrics.ts index 301a5467..5ae0c0cd 100644 --- a/lib/metrics.ts +++ b/lib/metrics.ts @@ -1,7 +1,5 @@ import PerformanceProxy from './dependencies/PerformanceProxy'; -const decoratedAliases = new Set(); - /** * Capture a measurement between the start mark and now */ @@ -21,11 +19,6 @@ function isPromiseLike(value: unknown): value is Promise { * Wraps a function with metrics capturing logic */ function decorateWithMetrics(func: (...args: Args) => ReturnType, alias = func.name) { - if (decoratedAliases.has(alias)) { - throw new Error(`"${alias}" is already decorated`); - } - - decoratedAliases.add(alias); function decorated(...args: Args) { const mark = PerformanceProxy.mark(alias, {detail: {args, alias}});