extract HomeModel from ContentView

huge refactor

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-05-24 12:57:40 -07:00
parent b230d430ee
commit 097cc54bba
27 changed files with 1221 additions and 371 deletions

View File

@@ -9,11 +9,19 @@ import Foundation
struct DamusState {
let pool: RelayPool
let pubkey: String
let keypair: Keypair
let likes: EventCounter
let boosts: EventCounter
let contacts: Contacts
let tips: TipCounter
let image_cache: ImageCache
let profiles: Profiles
var pubkey: String {
return keypair.pubkey
}
static var empty: DamusState {
return DamusState.init(pool: RelayPool(), keypair: Keypair(pubkey: "", privkey: ""), likes: EventCounter(our_pubkey: ""), boosts: EventCounter(our_pubkey: ""), contacts: Contacts(), tips: TipCounter(our_pubkey: ""), image_cache: ImageCache(), profiles: Profiles())
}
}