Skip to content

Commit

Permalink
Change default EventDispatcher generic to any
Browse files Browse the repository at this point in the history
Because of strict function types, we cannot assign a specific
EventDispatcher<T> to EventDispatcher<AbstractEvent>. To work
around this, have the default EventDispatcher type be
EventDispatcher<any>.
  • Loading branch information
Floris Bernard committed Feb 22, 2019
1 parent 77aaf21 commit 05a6b9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/lib/EventDispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import {
* by existing event dispatching systems like the functionality described in the
* [DOM Event W3 spec](https://www.w3.org/TR/DOM-Level-2-Events/events.html)
*/
export default class EventDispatcher<
TEvent extends AbstractEvent = AbstractEvent
> extends SengDisposable {
export default class EventDispatcher<TEvent extends AbstractEvent = any> extends SengDisposable {
/**
* The parent EventDispatcher instance. If this instance has no parent, this value will be
* set to _null_. The parent is used in the bubbling and capturing phases of events.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/EventListenerData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class EventListenerData<
> extends sengDisposable {
public dispatcher: EventDispatcher<TEvent>;
public type: TypesForEvent<TEvent>;
public handler: EventHandlerForEvent<any>;
public handler: EventHandlerForEvent<TEvent>;
public useCapture: boolean;
public priority: number;
/**
Expand Down

0 comments on commit 05a6b9d

Please sign in to comment.