// resources/js/Plugins/MittContext.jsx
import mitt from 'mitt';
import { createContext, useContext } from 'react';

export const emitter = mitt();

const MittContext = createContext(emitter);

export const MittProvider = ({ children }) => {
    return <MittContext.Provider value={emitter}>{children}</MittContext.Provider>;
};

export const useMitt = () => useContext(MittContext);
