Skip to content

Commit

Permalink
fix: allow generic types on event handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
luisburgos committed Aug 3, 2022
1 parent 8cd9e28 commit 3c0b41d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions lib/kinds/app_events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import '../infra/typed_event_handler.dart';

abstract class AppEvent {}

abstract class AppEventHandler extends TypedEventHandler<AppEvent> {}
abstract class AppEventHandler<A extends AppEvent>
extends TypedEventHandler<A> {}

class AppEventBus extends TypedEventBus<AppEvent> {}
class AppEventBus<A extends AppEvent> extends TypedEventBus<A> {}
4 changes: 2 additions & 2 deletions lib/kinds/commands.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import '../infra/typed_event_handler.dart';

abstract class Command {}

abstract class CommandHandler extends TypedEventHandler<Command> {}
abstract class CommandHandler<C extends Command> extends TypedEventHandler<C> {}

class CommandEventBus extends TypedEventBus<Command> {}
class CommandEventBus<C extends Command> extends TypedEventBus<C> {}
2 changes: 1 addition & 1 deletion lib/kinds/ui_events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '../infra/typed_event_handler.dart';

abstract class UiEvent {}

abstract class UIEventHandler extends TypedEventHandler<UiEvent> {}
abstract class UiEventHandler<U extends UiEvent> extends TypedEventHandler<U> {}

class UiEventBus extends TypedEventBus<UiEvent> {}

Expand Down

0 comments on commit 3c0b41d

Please sign in to comment.