eventsmodel: remove inheritence in Reactions/Reposts model

Simplify with new EventsModel constructors. This is slightly less
typesafe but its not a big deal, I hate inheritence more.

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-03-16 12:11:32 +00:00
parent 8cdbc84093
commit 68dd47130e
8 changed files with 17 additions and 52 deletions
+8
View File
@@ -23,6 +23,14 @@ class EventsModel: ObservableObject {
self.kind = kind
}
public static func reposts(state: DamusState, target: NoteId) -> EventsModel {
EventsModel(state: state, target: target, kind: .boost)
}
public static func likes(state: DamusState, target: NoteId) -> EventsModel {
EventsModel(state: state, target: target, kind: .like)
}
private func get_filter() -> NostrFilter {
var filter = NostrFilter(kinds: [kind])
filter.referenced_ids = [target]