Fix HookedService type error
This commit is contained in:
parent
0f02f0bd70
commit
f081a4a515
3 changed files with 10 additions and 6 deletions
|
@ -1,3 +1,7 @@
|
|||
# 2.0.5
|
||||
* Fix a new (did not appear before 2.6/2.7) type error causing compilation to fail.
|
||||
https://github.com/angel-dart/framework/issues/249
|
||||
|
||||
# 2.0.5-beta
|
||||
* Make `@Expose()` in `Controller` optional. https://github.com/angel-dart/angel/issues/107
|
||||
* Add `allowHttp1` to `AngelHttp2` constructors. https://github.com/angel-dart/angel/issues/108
|
||||
|
|
|
@ -95,12 +95,12 @@ class HookedService<Id, Data, T extends Service<Id, Data>>
|
|||
|
||||
/// Adds hooks to this instance.
|
||||
void addHooks(Angel app) {
|
||||
Hooks hooks = getAnnotation<Hooks>(inner, app.container.reflector);
|
||||
var hooks = getAnnotation<Hooks>(inner, app.container.reflector);
|
||||
List<HookedServiceEventListener<Id, Data, T>> before = [], after = [];
|
||||
|
||||
if (hooks != null) {
|
||||
before.addAll(hooks.before);
|
||||
after.addAll(hooks.after);
|
||||
before.addAll(hooks.before.cast());
|
||||
after.addAll(hooks.after.cast());
|
||||
}
|
||||
|
||||
void applyListeners(
|
||||
|
@ -111,7 +111,7 @@ class HookedService<Id, Data, T extends Service<Id, Data>>
|
|||
..addAll(isAfter == true ? after : before);
|
||||
|
||||
if (hooks != null) {
|
||||
listeners.addAll(isAfter == true ? hooks.after : hooks.before);
|
||||
listeners.addAll((isAfter == true ? hooks.after : hooks.before).cast());
|
||||
}
|
||||
|
||||
listeners.forEach(dispatcher.listen);
|
||||
|
|
|
@ -10,7 +10,7 @@ import 'di_test.dart' as di;
|
|||
import 'encoders_buffer_test.dart' as encoders_buffer;
|
||||
import 'env_test.dart' as env;
|
||||
import 'exception_test.dart' as exception;
|
||||
import 'extension_test.dart' as extension;
|
||||
import 'extension_test.dart' as extension_test;
|
||||
import 'find_one_test.dart' as find_one;
|
||||
import 'general_test.dart' as general;
|
||||
import 'hooked_test.dart' as hooked;
|
||||
|
@ -42,7 +42,7 @@ main() {
|
|||
group('encoders_buffer', encoders_buffer.main);
|
||||
group('env', env.main);
|
||||
group('exception', exception.main);
|
||||
group('extension', extension.main);
|
||||
group('extension', extension_test.main);
|
||||
group('find_one', find_one.main);
|
||||
group('general', general.main);
|
||||
group('hooked', hooked.main);
|
||||
|
|
Loading…
Reference in a new issue