Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
gwleuverink committed Jan 16, 2024
1 parent 465ef6c commit aadb567
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,12 @@ export default (() => {
})();
```

When importing this module you can omit the `as` prop. Axios will be available on the window object since the function is evaluated on import.

```html
<x-import module="~/bootstrap/axios" as="axios" />
<x-import module="~/bootstrap/axios" />

<script type="module">
// axios available, since it was attached to the window inside the IIFE
axios.get("/user/12345").then(function (response) {
console.log(response);
});
Expand Down

0 comments on commit aadb567

Please sign in to comment.