import { useContext, useEffect } from 'react';
import CommonContext from './CommonContext';
import { registerCommonDispatch } from './commonDispatch';
/** Registers CommonContext.dispatch for non-React callers (e.g. axios interceptors). */
export default function CommonDispatchBridge() {
    const { dispatch } = useContext(CommonContext);
    useEffect(() => {
        registerCommonDispatch(dispatch);
        return () => registerCommonDispatch(() => undefined);
    }, [dispatch]);
    return null;
}
