Common: Fix type hint for PyPubSubEventQueue.subscribe_type()

This commit is contained in:
Mike Salvatore 2022-08-10 09:21:54 -04:00
parent c0a9a8cf4d
commit a461226fec
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
from typing import Callable from typing import Callable, Type
from pubsub.core import Publisher from pubsub.core import Publisher
@ -19,7 +19,7 @@ class PyPubSubEventQueue(IEventQueue):
) )
def subscribe_type( def subscribe_type(
self, event_type: AbstractEvent, subscriber: Callable[[AbstractEvent], None] self, event_type: Type[AbstractEvent], subscriber: Callable[[AbstractEvent], None]
): ):
# pypubsub.pub.subscribe needs a string as the topic/event name # pypubsub.pub.subscribe needs a string as the topic/event name
self._pypubsub_publisher.subscribe(listener=subscriber, topicName=event_type.__name__) self._pypubsub_publisher.subscribe(listener=subscriber, topicName=event_type.__name__)