If your page has 1000s of the same icon, the loadIcon gets called 1000s of times before the if statement is true. The loadIcon method is slower than nuxt-icon calling this with each icon on the page.
You need to set either another variable that designates that you are already loading this icon, or set state.value[iconKey.value] with a temporary non-falsy value.
There is a race-condition that we finally found that was causing our app to "wait" for about 10 seconds.
If your page has 1000s of the same icon, the
loadIcon
gets called 1000s of times before the if statement is true. The loadIcon method is slower than nuxt-icon calling this with each icon on the page.You need to set either another variable that designates that you are already loading this icon, or set
state.value[iconKey.value]
with a temporary non-falsy value.