Skip to content

How do you pass client values to client.Go? #15

Answered by SteveMaybe
SteveMaybe asked this question in Q&A
Discussion options

You must be logged in to vote

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()
}

Replies: 1 comment 1 reply

Comment options

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

Answer selected by SteveMaybe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants