Files
Morten Olsen 35ef204433 foo
2023-03-29 15:10:30 +02:00

10 lines
250 B
TypeScript

import EventSource from 'eventsource';
const path = encodeURIComponent(window.location.pathname);
const source = new EventSource(`/dev?path=${path}`);
source.onmessage = (msg) => {
if (msg.data === 'reload') {
window.location.reload();
}
};