|
public func observe<T: TypedNotification>(_: T.Type, object: T.Sender?, queue: OperationQueue? = nil, block: @escaping T.ObservationBlock) -> TypedNotificationObservation { |
|
if T.Payload.self is DictionaryRepresentable.Type { |
|
let proxy = T.eraseNotificationName() |
|
return observe(proxy, object: object, queue: queue, block: block) |
|
} else { |
|
return _observe(T.self, object: object, queue: queue, block: block) |
|
} |
|
} |
|
|
|
public func post<T: TypedNotification>(_: T.Type, sender: T.Sender, payload: T.Payload) { |
|
if T.Payload.self is DictionaryRepresentable.Type { |
|
let proxy = T.eraseNotificationName() |
|
post(proxy, sender: sender, payload: payload) |
|
} else { |
|
_post(T.self, sender: sender, payload: payload) |
|
} |
|
} |