AEPKILL / devtools-detector

Detect if DevTools is open
https://blog.aepkill.com/demos/devtools-detector/
MIT License
1.11k stars 104 forks source link

activate performance checker only on prod build #44

Closed mirobo closed 2 years ago

mirobo commented 2 years ago

hey there

is it possible to NOT log "largeObject" to the console when the performance checker is just imported? When I import "performanceChecker" the code gets executed immediately and slows down execution of various tests...

const largeObject = createLargeObject();
const largeObjectArray: Record<string, string>[] = [];

for (let i = 0; i < 50; i++) {
  largeObjectArray.push(largeObject);
}

thanks! miro

AEPKILL commented 2 years ago

It's lazy initialization now

mirobo commented 2 years ago

It's lazy initialization now

thank you so much, I'll try it out :-D