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

Optimize multiple changes on the same delay #17

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

Conversation

jpamador
Copy link

When there are multiple changes within the delay window right now they are just queue instead of doing one per window.

When there are multiple changes within the delay window right now they are just queue instead of doing one per window.
@ElMassimo
Copy link
Owner

Hi there!

Would you describe your use case?

@jpamador
Copy link
Author

Hi!

I have an application that on certain occasions does several changes in a row to the backend. We are using your plugin (thanks btw!) with a delay of 2 seconds to give time for the backend to cool down, but what I have seen is that let's say I do 3 changes to the backend on those 2 seconds, I will then see 3 reloads, this change is to "aggregate" those changes in the delay window and just do one

@ElMassimo
Copy link
Owner

several changes in a row to the backend

Modifying files? Can you elaborate further?

@jpamador
Copy link
Author

I'm just developing an application with frontend and backend using JS, for development purposes I have a big window on the auto-refresh so that it give me time to do changes to different files in the backend before it refreshes so that its a complete change (that may involve changing 3 files). But as I mentioned before, with the current set up, when the window is up, I get 3 refreshed back to back instead of 1.

@patricknelson
Copy link

Essentially this is debouncing (e.g. https://browsersync.io/docs/options#option-reloadDebounce). What he’s saying (if I’m not mistaken) is that even though there’s currently a delay, even if you make several changes very quickly within that delay, they each trigger separate reloads (based on what I’m reading above, I haven’t installed this yet 😅).

@bjufre
Copy link

bjufre commented Jun 30, 2023

@ElMassimo @jpamador I think that this PR is something that also might help and does what we all need in a very controlled and simple way?

Or maybe I'm misunderstanding something @jpamador?

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.

4 participants