Skip to content

Commit

Permalink
fix: remove the in-memory set for decorated aliases to allow react in…
Browse files Browse the repository at this point in the history
…tegration
  • Loading branch information
adhorodyski committed Dec 10, 2024
1 parent 47c97b0 commit 586f4c2
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions lib/metrics.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import PerformanceProxy from './dependencies/PerformanceProxy';

const decoratedAliases = new Set();

/**
* Capture a measurement between the start mark and now
*/
Expand All @@ -21,11 +19,6 @@ function isPromiseLike(value: unknown): value is Promise<unknown> {
* Wraps a function with metrics capturing logic
*/
function decorateWithMetrics<Args extends unknown[], ReturnType>(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}});

Expand Down

0 comments on commit 586f4c2

Please sign in to comment.