mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -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])
|
||
|
}
|