This commit is contained in:
ct
2025-06-15 08:27:17 +08:00
parent f686de8f29
commit 361f630293
8 changed files with 215 additions and 72 deletions

View File

@@ -0,0 +1,13 @@
// 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);