12 lines
366 B
TypeScript
12 lines
366 B
TypeScript
// src/hooks/useFlyers.tsx
|
|
import { useContext } from 'react';
|
|
import { FlyersContext, FlyersContextType } from '../contexts/FlyersContext';
|
|
|
|
export const useFlyers = (): FlyersContextType => {
|
|
const context = useContext(FlyersContext);
|
|
if (context === undefined) {
|
|
throw new Error('useFlyers must be used within a FlyersProvider');
|
|
}
|
|
return context;
|
|
};
|