Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Classes/TopicEventBus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ open class TopicEventBus: TopicEventBusType {
}
}

@discardableResult
public func subscribe<T: TopicEvent>(callback: @escaping (T) -> Void) -> Listener {
return self.subscribe(topic: nil, callback: callback)
}

@discardableResult
public func subscribe<T: TopicEvent>(topic: String?, callback: @escaping (T) -> Void) -> Listener {
let className = NSStringFromClass(T.self)
if (self.subscribers.object(forKey: className as ClassName) == nil) {
Expand Down