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

Fixes #25 nil check #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fixes #25 nil check #26

wants to merge 1 commit into from

Conversation

davidrenne
Copy link

No description provided.

@davidrenne
Copy link
Author

davidrenne commented Jan 21, 2023

Can you also review and discuss this commit from another account I have?

cloud-ignite@7dfab0d

I thought this package could use a way to support a single argument to the callback functions. While it does complicate the simplicity of the original package in number of functions to interact with on the Debouncer struct, I would think people would appreciate either invoking a argument-less function or in the case of needing arguments, they would use WithAny() and SendSignalWithData() (note I thought it would be weird function name if it was "WithAny" so I decided on "WithData" but we can use any function name you want for this argument).

There's a lot more power in receiving data. Let's say you had a slider of 0-100 and the user is sliding up and down in .25 increments like crazy and you have a websocket binding from a web gui to golang. You use this package to send the values to this debouncer and then offload payloads every 250 milliseconds to a device because there are too many events happening as the user jumps up and down a slider sending events, but you want the last known "jump" or "increment" the person went crazy moving the volume on a slider. This parameter allows you to ignore all values and only send the last known value passed as an any type to your function which will then make an API request to a device for the volume change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant