import { useContext } from 'react' import { ConfigurationWatchContext, ConfigurationWatchContextType } from '../../contexts/ConfigurationWatch' export default function useConfigurationWatch(): ConfigurationWatchContextType { const context = useContext( ConfigurationWatchContext ) if ( ! context ) { throw new Error( 'useConfigurationWatch must be used within a ConfigurationWatchContextProvider' ) } return context }