notify: add typesafe notifications
This commit is contained in:
26
damus/Notify/RelaysChangedNotify.swift
Normal file
26
damus/Notify/RelaysChangedNotify.swift
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// RelaysChangedNotify.swift
|
||||
// damus
|
||||
//
|
||||
// Created by William Casarin on 2023-07-30.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct RelaysChangedNotify: Notify {
|
||||
typealias Payload = ()
|
||||
var payload: Payload
|
||||
}
|
||||
|
||||
extension NotifyHandler {
|
||||
static var relays_changed: NotifyHandler<RelaysChangedNotify> {
|
||||
.init()
|
||||
}
|
||||
}
|
||||
|
||||
extension Notifications {
|
||||
static var relays_changed: Notifications<RelaysChangedNotify> {
|
||||
.init(.init(payload: ()))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user