merge unison-reload

This commit is contained in:
tamaina
2021-02-14 23:11:05 +09:00
12 changed files with 89 additions and 12 deletions

View File

@@ -0,0 +1,10 @@
// SafariがBroadcastChannel未実装なのでライブラリを使う
import { BroadcastChannel } from 'broadcast-channel';
export const reloadChannel = new BroadcastChannel<'reload'>('reload');
// BroadcastChannelを用いて、クライアントが一斉にreloadするようにします。
export function unisonReload() {
reloadChannel.postMessage('reload');
location.reload();
}