Skip to content

Two way communication #2143

Answered by OlegGulevskyy
fairking asked this question in Q&A
Nov 29, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

There is an example included in every (I think) starter application of Wails. For example, I know for a fact - Svelte and React templates have it.
When you have a method declared on your App struct, this method is exposed to your frontend after generating module bindings.
Or simply put it - after you run wails dev or wails build. Your frontend folder will contains wailsjs folder with all the bindings.
I do however recommend checking out the templates and see how frontend makes the call to Go with a simple demo of Inputting your name, submitting it to the backend (Go) and it returns you a formatted string.

Not only you get data returned back from Go, but it is also type safe because you have

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@fairking
Comment options

Answer selected by fairking
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants