mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-09 06:52:30 -05: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])
|
||
|
}
|