$eventBus

Namespace

$eventBus

Description:
  • 프레임워크 이벤트 관리자

Author:
  • 이승갑 (dltmdrkq2@gmail.com)
  • 정민석 (whitn86@gmail.com)

Methods

(static) add(eventId, fn, thisObj)

Description:
  • $eventBus에 이벤트를 등록합니다. 하나의 eventId에는 thisObj별로 하나의 함수만 등록됩니다. 동일한 evenId와 thisObj의 값을 가진 이벤트가 등록되어있다면 해당 이벤트를 삭제하고 새로 추가합니다.

Example
$eventBus.add("onmainframeloaded", function(){
  $logger.trace('[system]',"메인 프레임 호출 완료");
}, thisObj);
Parameters:
Name Type Description
eventId string

이벤트아이디

fn function

이벤트 발생 시 수행할 함수

Properties
Name Type Description
e Object

이벤트 정보 객체

thisObj Object

이벤트를 가지고 있는 Object

(static) addOnce(eventId, fn, thisObj)

Description:
  • $eventBus에 일회성 이벤트를 등록합니다. 해당 메서드를 이용해 등록한 함수는 한번만 실행됩니다. 하나의 eventId에는 thisObj별로 하나의 함수만 등록됩니다. 이미 특정 evenId에 특정 thisObj로 이벤트가 등록되어있다면 해당 이벤트를 삭제하고 새로 추가합니다.

Example
$eventBus.addOnce("onmainframeloaded", function(){
  $logger.trace('[system]',"메인 프레임 호출 완료");
}, thisObj);
Parameters:
Name Type Description
eventId string

이벤트아이디

fn function

이벤트 발생 시 수행할 함수

Properties
Name Type Description
e Object

이벤트 정보 객체

thisObj Object

이벤트를 가지고 있는 Object

(static) clear()

Description:
  • $eventBus에 등록된 모든 이벤트를 삭제합니다.

Example
$eventBus.clear();

(static) fire(eventId, eventopt)

Description:
  • $eventBus에 등록된 모든 이벤트를 실행합니다.

Example
$eventBus.fire(eventId,{});
Parameters:
Name Type Attributes Description
eventId String

이벤트아이디

event Object <optional>

이벤트 정보 객체

(static) fireNext(eventId, eventopt)

Description:
  • 현재 $eventBus가 실행중인 최상단 event가 실행 완료된 후, event를 fire합니다.

Example
$eventBus.fireNext(eventId,{});
Parameters:
Name Type Attributes Description
eventId String

이벤트아이디

event Object <optional>

이벤트 정보 객체

(static) remove(eventId, thisObj)

Description:
  • $eventBus에 등록된 특정 이벤트를 삭제합니다.

Example
$eventBus.remove("onmainframeloaded", thisObj);
Parameters:
Name Type Description
eventId string

이벤트아이디

thisObj Object

이벤트를 가지고 있는 Object

(static) removeAll(eventId)

Description:
  • $eventBus에 특정 eventId로 등록된 모든 이벤트를 삭제합니다.

Example
$eventBus.removeAll("onmainframeloaded");
Parameters:
Name Type Description
eventId string

이벤트아이디