Mercurial > public > lazybear
view LazyBear/Views/Profile/Networking/Profile.swift @ 394:4c90e5b18632
Fixes #46
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Fri, 07 May 2021 11:00:53 +0200 |
parents | 6303385b3629 |
children | f843c6382529 |
line wrap: on
line source
// // Profile.swift // LazyBear // // Created by Dennis Concepción Martín on 7/5/21. // import SwiftUI class Profile: ObservableObject { @Published var showView = false @Published var data = ProfileResponse() func request(_ url: String, isInitRequest: Bool) { genericRequest(url: url, model: ProfileResponse.self) { response in // If is the first request -> init() if isInitRequest { self.data = response } else { // If not, request streaming data (without intradayPrices) self.data.quotes = response.quotes } self.showView = true } } }