Skip to content

armgit / uzu

Public Imported from GitHub
0

A high-performance inference engine for AI models

396 B
Raw Blame
import { useEffect } from "react";
import { bindChatLoading, bindChatSessionState } from "./adapters";

export const useSessionWiring = (enabled: boolean = true) => {
  useEffect(() => {
    if (!enabled) return;
    const unbindState = bindChatSessionState();
    const unbindLoading = bindChatLoading();
    return () => {
      unbindState();
      unbindLoading();
    };
  }, [enabled]);
};