FLUTTER ECOSYSTEM

iMeshAcademy/EventEmitter

dart용 EventEmitter. 이는 어떤 응용 프로그램에서 이벤트를 등록하고 발생했을 때 알림을 받는 데 사용할 수 있습니다.

EventEmitter 프로젝트 이미지
Stars
12
Forks
4
최근 푸시(UTC)
2022. 6. 16.
프로젝트 상태
활성
iMeshAcademy GitHub avatar
GITHUB User

iMeshAcademy ↗

언어Dart

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 3 개
  • test개발 의존성^1.0.0
  • pedantic개발 의존성^1.11.0
  • lints개발 의존성^1.0.1

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

EventEmitter

EventEmitter for dart. This can be used in any application to register for events and get notified once it is fired.


This library provide mechanism to register for event notifications with emitter or publisher and get notified in the event of an event.

One main advantage of the mehanism is that, it support context from where the subscriber is listening. The context could be any additional data the subscriber is interested in.

Another feature this has is the ability to receive sender information, which could be handy if the subscriber wish to know about the publisher.

Example

    void performAddition(){

    }

    EventCallback cb = (ev, cont) {
        if (null != ev) {
          switch (ev.eventName) {
            case "add":
              performAddition();
              break;
          }
        }
      };

    EventEmitter emitter = new EventEmitter();
    Listener listener = emitter.on("add", this , cb);

    emitter.emit("add","keyboard",10);


As shown in the above example, it is easy to register for events and get notified once it is triggered.