feature/IO-3198-Seperate-Socket-Provider-useSocket

This commit is contained in:
Dave Richer
2025-04-03 13:10:24 -04:00
parent 0ef030bb89
commit b44b71072f
24 changed files with 40 additions and 38 deletions

View File

@@ -0,0 +1,13 @@
import { createContext, useContext } from "react";
const SocketContext = createContext(null);
const INITIAL_NOTIFICATIONS = 10;
const useSocket = () => {
const context = useContext(SocketContext);
if (!context) throw new Error("useSocket must be used within a SocketProvider");
return context;
};
export { SocketContext, INITIAL_NOTIFICATIONS, useSocket };