Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

272 B
Raw Blame
import { useSyncExternalStore } from 'react';
import { getBranchSnapshot, subscribeToBranch } from '@/lib/current-branch-store';

export function useCurrentBranch(): string | null {
  return useSyncExternalStore(subscribeToBranch, getBranchSnapshot, getBranchSnapshot);
}