refactor(docs): remove unused broadcastedRef composable

This commit is contained in:
2026-06-15 17:49:59 +07:00
parent 98b76f46cf
commit 91fa464d95
@@ -1,27 +0,0 @@
import { customRef, onScopeDispose } from 'vue';
export function broadcastedRef<T>(key: string, initialValue: T) {
const channel = new BroadcastChannel(key);
onScopeDispose(channel.close);
return customRef<T>((track, trigger) => {
channel.onmessage = (event) => {
track();
return event.data;
};
channel.postMessage(initialValue);
return {
get() {
return initialValue;
},
set(newValue: T) {
initialValue = newValue;
channel.postMessage(newValue);
trigger();
},
};
});
}