Add user and rooms to global state

This commit is contained in:
2023-11-20 17:52:51 +07:00
parent 8377a7d5b0
commit 4aae26e994
15 changed files with 329 additions and 43 deletions
@@ -0,0 +1,16 @@
import { UserRoomAvailableContext } from '@context/UserRoomAvailableContext';
import { useContext } from 'react';
const useUserRoomAvailable = () => {
const context = useContext(UserRoomAvailableContext);
if (context === undefined) {
throw new Error(
'UserRoomAvailableContext was used outside of UserRoomAvailableProvider'
);
}
return context;
};
export { useUserRoomAvailable };