notify: add typesafe notifications

This commit is contained in:
William Casarin
2023-07-30 10:48:56 -07:00
parent df3b94a1fc
commit 80063af19a
28 changed files with 795 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
//
// NewUnmutesNotify.swift
// damus
//
// Created by William Casarin on 2023-07-30.
//
import Foundation
struct NewUnmutesNotify: Notify {
typealias Payload = Set<Pubkey>
var payload: Payload
}
extension NotifyHandler {
static var new_unmutes: NotifyHandler<NewUnmutesNotify> {
.init()
}
}
extension Notifications {
static func new_unmutes(_ pubkeys: Set<Pubkey>) -> Notifications<NewUnmutesNotify> {
.init(.init(payload: pubkeys))
}
}