Files
shakespeare/src/hooks/useFS.ts
T
2025-07-20 15:31:29 -05:00

14 lines
395 B
TypeScript

import { useContext } from 'react';
import { FSContext, type FSContextType } from '@/contexts/FSContext';
/**
* Hook to access the filesystem
* @returns Filesystem context with fs instance
*/
export function useFS(): FSContextType {
const context = useContext(FSContext);
if (context === undefined) {
throw new Error('useFS must be used within a FSProvider');
}
return context;
}