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:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user