leotaku / tower-livereload

Tower middleware to automatically reload your web browser during development
Apache License 2.0
59 stars 5 forks source link

Customizable reload interval #4

Closed wrapperup closed 1 year ago

wrapperup commented 1 year ago

This allows you to define the interval for the live-reload check in the script. Sometimes it felt sluggish to iterate, since you would be caught in a long end of the 1-second cycle.

For example, it can be customized like so:

LiveReloadLayer::new().reload_interval(Duration::from_millis(100))
leotaku commented 1 year ago

Sorry for having ignored this for so long, I've been very busy. I should have some time to review and possibly merge this weekend. In any case, thanks for contributing!

leotaku commented 1 year ago

Merged with minor code style and doc changes.