dify/web/context/event-emitter-provider.tsx
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

19 lines
549 B
TypeScript

'use client'
import type { ReactNode } from 'react'
import type { EventEmitterValue } from './event-emitter'
import { useEventEmitter } from 'ahooks'
import { EventEmitterContext } from './event-emitter'
type EventEmitterContextProviderProps = {
children: ReactNode
}
export const EventEmitterContextProvider = ({ children }: EventEmitterContextProviderProps) => {
const eventEmitter = useEventEmitter<EventEmitterValue>()
return (
<EventEmitterContext.Provider value={{ eventEmitter }}>{children}</EventEmitterContext.Provider>
)
}