mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
13 lines
333 B
TypeScript
13 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])
|
||
|
}
|