Skip to content

Commit 3315bd6

Browse files
committed
refactor/#70 :: Decoder 생성
1 parent f95f4c1 commit 3315bd6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

PhotoGether/DataLayer/PhotoGetherData/PhotoGetherData/EventConnection/EventConnectionGuestRepositoryImpl.swift

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@ public final class EventConnectionGuestRepositoryImpl: EventConnectionRepository
77
private var cancellables: Set<AnyCancellable> = []
88
private var receiveDataFromHost = PassthroughSubject<Data, Never>()
99

10-
private var decoder: JSONDecoder = {
11-
let decoder = JSONDecoder()
12-
decoder.dateDecodingStrategy = .iso8601
13-
return decoder
14-
}()
10+
private let decoder: JSONDecoder
1511

1612
public init(clients: [ConnectionClient]) {
1713
self.clients = clients
14+
self.decoder = JSONDecoder()
15+
16+
setupDecoder()
1817
bindData()
1918
}
2019

20+
private func setupDecoder() {
21+
decoder.dateDecodingStrategy = .iso8601
22+
}
23+
2124
private func bindData() {
2225
// MARK: Host로 부터 들어오는 Data를 send한다.
2326
// clients.filter { $0 == .host }

0 commit comments

Comments
 (0)