Skip to content

Instantly share code, notes, and snippets.

View fimion's full-sized avatar
🦄
I'M A UNICORN!!

Alex Riviere fimion

🦄
I'M A UNICORN!!
View GitHub Profile
@fimion
fimion / server-hot-reload.js
Last active August 18, 2023 20:26 — forked from mikeckennedy/server-hot-reload.js
Server-side hot reload checker by Michael Kennedy. When the contents of the page change in any way, the page will be reloaded.
// *************************************************************************
// Server-side hot reload check by Michael Kennedy (https://mkennedy.codes).
// Released under the MIT open source license, 2023.
//
// Usage: Include this file in your "application shell" layout template
// or directly into any page you'd like to check.
//
// Set the checkIntervalInMs time to the frequency you need. Usually 1 sec
// should be fine, but if a page is slow maybe increase the delay.
//