Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ function loadScript({ src, id, data }) {
// once the lib is registered you can resolve immediatelly
// because it means that is fully loaded

if (window.__loadedLibraries.indexOf(src) > -1) {
if (window.__loadedLibraries.indexOf(id) > -1) {
resolve(`${id} was loaded before`)
}

script.addEventListener('load', function onLoadScript() {
script.removeEventListener('load', onLoadScript)
registerLibraryLoaded(src)
registerLibraryLoaded(id)
resolve(id)
})

Expand Down