mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
23e2d9bf99
GitOrigin-RevId: 3c93491041170cd78c66bc0ab5db516749f9eded
12 lines
333 B
TypeScript
12 lines
333 B
TypeScript
import { useEffect } from 'react'
|
|
import { useUserContext } from '@/shared/context/user-context'
|
|
import { useUserChannel } from './use-user-channel'
|
|
|
|
export const useBroadcastUser = () => {
|
|
const user = useUserContext()
|
|
const channel = useUserChannel()
|
|
|
|
useEffect(() => {
|
|
channel?.postMessage(user)
|
|
}, [channel, user])
|
|
}
|