Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

273 B
Raw Blame
import { useSyncExternalStore } from "react";

import { speaker, type SpeechSnapshot } from "./index";

export function useSpeech(): SpeechSnapshot {
  return useSyncExternalStore(
    (fn) => speaker.subscribe(fn),
    () => speaker.state,
    () => speaker.state,
  );
}