Skip to content

Commit

Permalink
Give explicity example of importing JS runtime
Browse files Browse the repository at this point in the history
No where in the docs, google, github issues or discussions could I find an example of importing the runtime JS but after some experimentation I figured it out.

I think it would help future users if a simple example was shown like this so they have a clear reference of how to import the runtime.
  • Loading branch information
danawoodman authored Jan 7, 2024
1 parent f7c1946 commit 88178c2
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ The JavaScript library is available to the frontend via the `window.runtime` map
mode that provides TypeScript declarations for the runtime. This should be located in the `wailsjs` directory in your
frontend directory.

e.g. if you wanted to import the [EventsOn](./events/#eventson) function in a Svelte app, you can do the following:

```ts
// src/App.svelte (for example)
import { EventsOn } from '../wailsjs/runtime'
```

### Hide

Go: `Hide(ctx context.Context)`<br/>
Expand Down

0 comments on commit 88178c2

Please sign in to comment.