Kurdtvs-Live-Kurdish-TV-Kur.../Mastodon/Scene/Onboarding/ConfirmEmail/MastodonConfirmEmailViewMod...

41 lines
1.1 KiB
Swift
Raw Normal View History

2021-02-23 08:38:05 +01:00
//
// MastodonConfirmEmailViewModel.swift
// Mastodon
//
// Created by sxiaojian on 2021/2/23.
//
import Combine
import Foundation
import MastodonSDK
2021-02-23 08:38:05 +01:00
final class MastodonConfirmEmailViewModel {
var disposeBag = Set<AnyCancellable>()
// input
2021-02-23 08:38:05 +01:00
let context: AppContext
var email: String
let authenticateInfo: AuthenticationViewModel.AuthenticateInfo
let userToken: Mastodon.Entity.Token
let updateCredentialQuery: Mastodon.API.Account.UpdateCredentialQuery
let timestampUpdatePublisher = Timer.publish(every: 4.0, on: .main, in: .common)
.autoconnect()
.share()
.eraseToAnyPublisher()
init(
context: AppContext,
email: String,
authenticateInfo: AuthenticationViewModel.AuthenticateInfo,
userToken: Mastodon.Entity.Token,
updateCredentialQuery: Mastodon.API.Account.UpdateCredentialQuery
) {
2021-02-23 08:38:05 +01:00
self.context = context
self.email = email
self.authenticateInfo = authenticateInfo
self.userToken = userToken
self.updateCredentialQuery = updateCredentialQuery
2021-02-23 08:38:05 +01:00
}
}