import { addCollection } from '@iconify/vue/offline'
|
|
let iconCollectionsRegistered = false
|
let iconCollectionsPromise = null
|
|
export async function registerLocalIconCollections() {
|
if (iconCollectionsRegistered) {
|
return
|
}
|
|
if (!iconCollectionsPromise) {
|
iconCollectionsPromise = import('./iconify.collections.js')
|
.then(({ LOCAL_ICON_COLLECTIONS }) => {
|
Object.values(LOCAL_ICON_COLLECTIONS).forEach((collection) => {
|
addCollection(collection)
|
})
|
iconCollectionsRegistered = true
|
})
|
.catch((error) => {
|
iconCollectionsPromise = null
|
throw error
|
})
|
}
|
|
await iconCollectionsPromise
|
}
|