57
This commit is contained in:
parent
ba9df69779
commit
58d5b0972e
3 changed files with 6 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
# angel_framework
|
# angel_framework
|
||||||
|
|
||||||
[![pub 1.0.0-dev.56](https://img.shields.io/badge/pub-1.0.0--dev.56-red.svg)](https://pub.dartlang.org/packages/angel_framework)
|
[![pub 1.0.0-dev.57](https://img.shields.io/badge/pub-1.0.0--dev.57-red.svg)](https://pub.dartlang.org/packages/angel_framework)
|
||||||
[![build status](https://travis-ci.org/angel-dart/framework.svg)](https://travis-ci.org/angel-dart/framework)
|
[![build status](https://travis-ci.org/angel-dart/framework.svg)](https://travis-ci.org/angel-dart/framework)
|
||||||
|
|
||||||
Core libraries for the Angel Framework.
|
Core libraries for the Angel Framework.
|
||||||
|
|
|
@ -494,15 +494,15 @@ class HookedService extends Service {
|
||||||
}
|
}
|
||||||
|
|
||||||
var ev = new HookedServiceEvent(true, null, null, this, eventName);
|
var ev = new HookedServiceEvent(true, null, null, this, eventName);
|
||||||
return await fireEvent(dispatcher, ev);
|
return await fireEvent(dispatcher, ev, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sends an arbitrary event down the hook chain.
|
/// Sends an arbitrary event down the hook chain.
|
||||||
Future<HookedServiceEvent> fireEvent(
|
Future<HookedServiceEvent> fireEvent(
|
||||||
HookedServiceEventDispatcher dispatcher, HookedServiceEvent event,
|
HookedServiceEventDispatcher dispatcher, HookedServiceEvent event,
|
||||||
[HookedServiceEventListener callback]) async {
|
[HookedServiceEventListener callback]) async {
|
||||||
if (callback != null && event._canceled != true) await callback(ev);
|
if (callback != null && event?._canceled != true) await callback(event);
|
||||||
return await dispatcher._emit(ev);
|
return await dispatcher._emit(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,7 +565,7 @@ class HookedServiceEventDispatcher {
|
||||||
|
|
||||||
/// Fires an event, and returns it once it is either canceled, or all listeners have run.
|
/// Fires an event, and returns it once it is either canceled, or all listeners have run.
|
||||||
Future<HookedServiceEvent> _emit(HookedServiceEvent event) async {
|
Future<HookedServiceEvent> _emit(HookedServiceEvent event) async {
|
||||||
if (event._canceled != true) {
|
if (event?._canceled != true) {
|
||||||
for (var listener in listeners) {
|
for (var listener in listeners) {
|
||||||
await listener(event);
|
await listener(event);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: angel_framework
|
name: angel_framework
|
||||||
version: 1.0.0-dev.56
|
version: 1.0.0-dev.57
|
||||||
description: Core libraries for the Angel framework.
|
description: Core libraries for the Angel framework.
|
||||||
author: Tobe O <thosakwe@gmail.com>
|
author: Tobe O <thosakwe@gmail.com>
|
||||||
homepage: https://github.com/angel-dart/angel_framework
|
homepage: https://github.com/angel-dart/angel_framework
|
||||||
|
|
Loading…
Reference in a new issue