Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debounce input #317

Open
jbrodriguez opened this issue Jul 21, 2024 · 0 comments
Open

debounce input #317

jbrodriguez opened this issue Jul 21, 2024 · 0 comments
Labels
input question Further information is requested

Comments

@jbrodriguez
Copy link

how can i debounce the input ? i tried this

	debounced := debounce.New(400 * time.Millisecond)
	//
	fn := func() []huh.Option[string] {
		opts := make([]huh.Option[string], 0)

		debounced(func() {
		 // fill opts based on inputVarBinding
		})

		return opts
	}

...
OptionsFunc(fn, &inputVarBinding)

but it always returns an empty array
(debounce comes from https://github.com/bep/debounce)
also, the code inside debounced actually runs, it just never returns the value upstream 🤷‍♂️
if i remove the debounced call, it works

@caarlos0 caarlos0 added bug Something isn't working input question Further information is requested and removed bug Something isn't working labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
input question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants