-
Notifications
You must be signed in to change notification settings - Fork 0
[Refactor] 전체적인 코드 리팩토링 #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
|
||
| @propertyWrapper | ||
| public struct Dependency<T> { | ||
| public let wrappedValue: T | ||
|
|
||
| public init() { | ||
| self.wrappedValue = DIContainer.shared.resolve() | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reducer에서 의존성을 쉽게 불러오기 위한 프로퍼티 래퍼입니다.
@Dependency private var useCase: UseCase| public struct LinkMetadataProviderImpl: LinkMetadataProvider { | ||
| private let metadataProvider = LPMetadataProvider() | ||
|
|
||
| public init() {} | ||
|
|
||
| public func fetchMetadata(urlString: String) async -> Result<LinkMetadata, LinkMetadataError> { | ||
| let metadataProvider = LPMetadataProvider() | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetchMetadata(urlString:)을 두번 연속 호출하게 되면서 발생할 수 있는 LinkMetadataError.concurrentFetchNotAllowed 에러를 방지하기 위해 메서드 내에서 LPMetadataProvider 객체를 생성해서 사용하도록 수정했습니다.
|
|
||
| enum AuthError: Error { | ||
| case unauthenticated | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인증되지 않은 상태에서 허용되지 않은 접근(ex. 모든 링크, 폴더 가져오기 ...)을 할 경우 발생시킬 에러 타입을 정의했습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Firestore와 Storage 경로를 구분했습니다.
| import Foundation | ||
|
|
||
| struct Link: Hashable { | ||
| struct WebLink: Hashable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
View에서 웹페이지를 띄우기 위해 사용되는 View Component인 Link와 네이밍이 겹쳐 수정했습니다.



#️⃣ 연관된 이슈
📝 작업 내용
아래 작업을 수행했습니다.
🎨 스크린샷
💬 추가 설명