RocketChat/Rocket.Chat

View on GitHub
apps/meteor/client/views/room/contexts/ChatContext.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { createContext, useContext } from 'react';

import type { ChatAPI } from '../../../lib/chats/ChatAPI';

type ChatContextValue = ChatAPI | undefined;

export const ChatContext = createContext<ChatContextValue>(undefined);

export const useChat = (): ChatContextValue => useContext(ChatContext);