mirror of
https://github.com/langgenius/dify.git
synced 2026-09-21 05:11:22 +08:00
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
19 lines
549 B
TypeScript
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>
|
|
)
|
|
}
|