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

Set default debounce time in CableReady::Config #263

Merged
merged 4 commits into from
Mar 2, 2023

Conversation

julianrubisch
Copy link
Contributor

Enhancement

Description

Allows to set the default updatable_debounce_time in the CableReady config. This allows every application to set it to a desired value

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing

@julianrubisch julianrubisch added enhancement ruby Pull requests that update Ruby code labels Mar 1, 2023
@julianrubisch julianrubisch requested a review from hopsoft March 1, 2023 19:58
@julianrubisch julianrubisch self-assigned this Mar 1, 2023
@netlify
Copy link

netlify bot commented Mar 1, 2023

Deploy Preview for cableready ready!

Name Link
🔨 Latest commit fd98bd3
🔍 Latest deploy log https://app.netlify.com/sites/cableready/deploys/64010b5ad3753100084d666f
😎 Deploy Preview https://deploy-preview-263--cableready.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@marcoroth marcoroth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@julianrubisch looks good to me! Could you add a test for it? I recently added #254 which should be super straightforward.

@julianrubisch
Copy link
Contributor Author

@julianrubisch looks good to me! Could you add a test for it? I recently added #254 which should be super straightforward.

I wanted to, but it introduces a race condition which sometimes breaks updatable tests 😕

@marcoroth
Copy link
Member

Could we resolve that with a similar helper method we added in StimulusReflex?

https://github.com/marcoroth/stimulus_reflex/blob/dcb7048f60611185f34bda4744e4e81e1000d40e/test/configuration_test.rb#L5-L11

@julianrubisch
Copy link
Contributor Author

I’ll give it a try!

@julianrubisch
Copy link
Contributor Author

Splendid! 🙌

@hopsoft this also allows us to leave the default debounce time at 0.1 seconds

@julianrubisch julianrubisch merged commit 7943eaa into main Mar 2, 2023
@julianrubisch julianrubisch deleted the default-debounce-time branch March 2, 2023 20:48
Comment on lines +22 to +26

# Specify a default debounce time for CableReady::Updatable callbacks
# Doing so is a best practice to avoid heavy ActionCable traffic
#
# config.updatable_debounce_time = 0.1.seconds
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants