Skip to contentOpen History to see the last commit
use-byok.ts
6 lines257 Bytes
1import { useSyncExternalStore } from 'preact/compat' 2import type { ByokClient, ByokSnapshot } from '@tanstack/ai-client/byok' 4export function useByok(client: ByokClient): ByokSnapshot { 5 return useSyncExternalStore(client.subscribe, client.getSnapshot)