mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
foo
This commit is contained in:
9
bin/resources/page/client.ts
Normal file
9
bin/resources/page/client.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
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();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user