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

[REF-2250] Investigate generic debounce #2872

Closed
picklelo opened this issue Mar 18, 2024 · 2 comments
Closed

[REF-2250] Investigate generic debounce #2872

picklelo opened this issue Mar 18, 2024 · 2 comments
Labels
help wanted Extra attention is needed needs investigation

Comments

@picklelo
Copy link
Contributor

picklelo commented Mar 18, 2024

Currently the rx.debounce works well with inputs and textareas. Is there a way we can generalize this to work for all components such as rx.slider or the color picker example in the docs?

Current docs: https://reflex.dev/docs/library/forms/debounce/#debounce

REF-2250

@picklelo picklelo added help wanted Extra attention is needed needs investigation labels Mar 18, 2024
@picklelo picklelo changed the title Investigate generic debounce [REF-2250] Investigate generic debounce Mar 18, 2024
@picklelo
Copy link
Contributor Author

picklelo commented Apr 4, 2024

Modifying queueEvents like this within utils/state.js seems to work. We should probably make this a flag though, we mayn't want to do this for all events.

export const queueEvents = async (events, socket) => {
  // Filter out any events already in the queue.
  events = events.filter((event) => {
    for (const queued_event of event_queue) {
      if (queued_event.name === event.name) {
        return false;
      }
    }
    return true;
  });
  event_queue.push(...events);
  await processEvent(socket.current);
};

@masenf
Copy link
Collaborator

masenf commented May 29, 2024

fixed in #3091

@masenf masenf closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants