Skip to content

Commit

Permalink
doc: fix incorrect reference to "importMapReady" (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
kfrederix authored Oct 2, 2024
1 parent fc9d5b5 commit 7eea9dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ If you're not using external import maps (`<script type="injector-importmap" src

#### Asynchronous import map installation

When using external import maps, import-map-injector must wait for the network request(s) loading external import map(s) to complete before it can install the browser-native import map. This means you cannot use `<script type="module">` and `import()` in your HTML file until after the import-map-injector's `importMapReady` Promise has been resolved:
When using external import maps, import-map-injector must wait for the network request(s) loading external import map(s) to complete before it can install the browser-native import map. This means you cannot use `<script type="module">` and `import()` in your HTML file until after the import-map-injector's `initPromise` Promise has been resolved:

**Example:**

Expand All @@ -171,7 +171,7 @@ When using external import maps, import-map-injector must wait for the network r
before loading modules with <script type="module"> or import()
-->
<script>
window.importMapInjector.importMapReady.then(() => {
window.importMapInjector.initPromise.then(() => {
console.log("Ready to dynamically import modules");
import("my-module");
});
Expand Down

0 comments on commit 7eea9dc

Please sign in to comment.