mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-15 07:30:57 -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])
|
||
|
}
|