How do you pass client values to client.Go? #15
Answered
by
SteveMaybe
SteveMaybe
asked this question in
Q&A
-
Sorry for all the questions 😬, and thanks for bearing with me! Once I have a better understanding of how this all comes together, hopefully I can help contribute some examples. I'm trying to understand how to pass the clientside variables back to the server. func main() {
dataInput := &clientside.String{}
app.New("Hello World",
div.New(
text.Set("What is your name? "),
textbox.New(textbox.Update(dataInput), client.OnChange(client.Go(func() {
fmt.Printf("Their name is %s\n", dataInput.GetString())
}))),
),
).Launch()
} |
Beta Was this translation helpful? Give feedback.
Answered by
SteveMaybe
Jan 18, 2021
Replies: 1 comment 1 reply
-
Aha, I got it! func main() {
dataInput := &clientside.String{}
app.New("Hello World",
div.New(
text.Set("What is your name? "),
textbox.New(textbox.Update(dataInput), client.OnClick(client.Go(func(a string) {
fmt.Printf("Their name is %s\n", a)
}, dataInput))),
),
).Launch()
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
SteveMaybe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Aha, I got it!