EventHandler class

메서드

addEventCallback(EventCallbackFunction, EventType[], string)

배열에 이벤트 콜백 추가

emitEvent(EventType, InteractionType, EventPayload, EventError)

이벤트 메시지와 함께 콜백을 호출하여 이벤트를 내보냅니다.

removeEventCallback(string)

콜백 배열에서 제공된 ID를 사용하여 콜백을 제거합니다.

subscribeCrossTab()

다른 탭/인스턴스에서 브로드캐스트된 이벤트 수신 대기

unsubscribeCrossTab()

브로드캐스트 이벤트 구독 취소

생성자 세부 정보

EventHandler(Logger)

new EventHandler(logger?: Logger)

매개 변수

logger
Logger

메서드 세부 정보

addEventCallback(EventCallbackFunction, EventType[], string)

배열에 이벤트 콜백 추가

function addEventCallback(callback: EventCallbackFunction, eventTypes?: EventType[], callbackId?: string): null | string

매개 변수

callback
EventCallbackFunction

이벤트가 발생할 때 호출할 콜백

eventTypes

EventType[]

이 콜백이 호출될 이벤트 목록이며, 제공되지 않은 경우 모든 이벤트에 대해 콜백이 호출됩니다.

callbackId

string

더 이상 필요하지 않을 때 콜백을 찾아 제거하는 데 사용되는 콜백의 식별자입니다.

반품

null | string

emitEvent(EventType, InteractionType, EventPayload, EventError)

이벤트 메시지와 함께 콜백을 호출하여 이벤트를 내보냅니다.

function emitEvent(eventType: EventType, interactionType?: InteractionType, payload?: EventPayload, error?: EventError)

매개 변수

eventType
EventType
interactionType
InteractionType
payload
EventPayload
error
EventError

removeEventCallback(string)

콜백 배열에서 제공된 ID를 사용하여 콜백을 제거합니다.

function removeEventCallback(callbackId: string)

매개 변수

callbackId

string

subscribeCrossTab()

다른 탭/인스턴스에서 브로드캐스트된 이벤트 수신 대기

function subscribeCrossTab()

unsubscribeCrossTab()

브로드캐스트 이벤트 구독 취소

function unsubscribeCrossTab()