GeOnDT GeOnDT for JS

Class: UEventDispatcher

UEventDispatcher

최상위 객체. 이벤트 디스패쳐, 이벤트 관리

new UEventDispatcher(opt)

Name Type Default Description
opt UEventDispatcher~UEventDispatcherCO {} optional

Methods

dispatchEvent(event, data)

이벤트를 발생시키는 메서드

Name Type Description
event string | UEventDispatcher~DispatchInputEvent

이벤트 타입

data any optional

이벤트 함수로 넘길 데이터

emit(event, data)

Name Type Description
event string | UEventDispatcher~DispatchInputEvent
data any optional

hasEventListener(type, listener)boolean

이벤트 등록 여부를 반환하는 메서드

Name Type Description
type string

이벤트 타입

listener EventCallBack | string

이벤트 함수 또는 함수 ID

Returns:
Type Description
boolean 등록 여부. true면 등록됨, false면 등록 안됌

hasEventType(type)boolean

이벤트 타입이 등록되어 있는지 확인하는 메서드

Name Type Description
type string

이벤트 타입

Returns:
Type Description
boolean 등록 여부

off(type, listener)

이벤트 제거 메서드

Name Type Description
type string optional

이벤트 타입

listener function | string optional

이벤트 함수 또는 ID

on(type, listener, once, name)string|null

Name Type Default Description
type string

이벤트 타입

listener EventCallBack

이벤트 함수

once boolean | undefined false optional

한번만 동작할지 여부. true면 1회 동작

name string | undefined optional

이벤트 함수 식별 이름 (ID)

Returns:
Type Description
string | null 등록된 이벤트 함수 식별 이름. 등록 실패 시 null 반환

once(type, listener, name)string|null

1회만 동작하는 이벤트를 등록하는 메서드

Name Type Description
type string

이벤트 타입

listener EventCallBack

이벤트 함수

name string optional

이벤트 함수 식별 이름 (ID)

Returns:
Type Description
string | null 등록된 이벤트 함수 식별 이름. 등록 실패 시 null 반환

unkey(type, key)

이벤트 명시적 해제 메서드

Name Type Description
type string

이벤트 타입

key string optional

이벤트 함수 ID

Type Definitions

DispatchInputEventobject

이벤트를 디스패치 할때의 입력 객체 인터페이스 입니다.

Properties:
Name Type Argument Description
type string

이벤트 타입

data any <optional>

디스패치 데이터

target UEventDispatcher | undefined | null <optional>

디스패치 발생 객체

UEventDispatcherCOobject

UEventDispatcher 생성자 옵션 입니다.