Skip to content

Commit

Permalink
[Refactor/#84] Combine 활용해서 서버통신 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
HELLOHIDI committed Aug 15, 2024
1 parent 6bb7717 commit 38ec1c0
Show file tree
Hide file tree
Showing 17 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
import DSKit
import UIKit

public enum MyPageButtonType {
enum MyPageButtonType_Refactor {
case travel
case market
case term
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct MyPageButton_Refactor: View {

@ObservedObject var viewModel: MyPageViewModel_Refactor

var buttonType: MyPageButtonType
var buttonType: MyPageButtonType_Refactor

var body: some View {
ZStack {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class MyPageViewModel_Refactor: ObservableObject {
switch action {
case .getUserData:
container.services.userService.getUserData()
.sink { _ in

.sink { _ in
} receiveValue: { [weak self] data in
self?.name = data.data?.name ?? ""
self?.point = data.data?.point ?? 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ public struct MyPageView_Refactor: View {


@State private var isPresented: Bool = false

@StateObject var viewModel: MyPageViewModel_Refactor



public var body: some View {
VStack {
Spacer()
Expand Down

0 comments on commit 38ec1c0

Please sign in to comment.