extract HomeModel from ContentView
huge refactor Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user