mirror of
https://github.com/chartdb/chartdb.git
synced 2025-11-04 22:13:15 +00:00
11 lines
293 B
TypeScript
11 lines
293 B
TypeScript
import { useContext } from 'react';
|
|
import { diffContext } from './diff-context';
|
|
|
|
export const useDiff = () => {
|
|
const context = useContext(diffContext);
|
|
if (context === undefined) {
|
|
throw new Error('useDiff must be used within an DiffProvider');
|
|
}
|
|
return context;
|
|
};
|