Support typed errors. Misc formatting

This commit is contained in:
John Estropia
2024-09-10 11:14:39 +09:00
parent c9e091a6a4
commit 5dcf29011a
74 changed files with 3987 additions and 1441 deletions

View File

@@ -35,7 +35,12 @@ extension Internals {
// MARK: Internal
internal init(notificationName: Notification.Name, object: Any?, queue: OperationQueue? = nil, sharedValue: @escaping (_ note: Notification) -> T) {
internal init(
notificationName: Notification.Name,
object: Any?,
queue: OperationQueue? = nil,
sharedValue: @escaping (_ note: Notification) -> T
) {
self.observer = NotificationCenter.default.addObserver(
forName: notificationName,
@@ -59,9 +64,15 @@ extension Internals {
self.observers.removeAllObjects()
}
internal func addObserver<U: AnyObject>(_ observer: U, closure: @escaping (T) -> Void) {
internal func addObserver<U: AnyObject>(
_ observer: U,
closure: @escaping (T) -> Void
) {
self.observers.setObject(Closure<T, Void>(closure), forKey: observer)
self.observers.setObject(
Closure<T, Void>(closure),
forKey: observer
)
}
internal func removeObserver<U: AnyObject>(_ observer: U) {