Skip to content
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

refactor: Dependencies migration #134

Merged
merged 16 commits into from
Oct 2, 2024
Merged

Conversation

stealmh
Copy link
Member

@stealmh stealmh commented Sep 30, 2024

#️⃣연관된 이슈

#133

📝작업 내용

  • @DependencyClient 매크로로 리팩토링하였습니다.
  • Live, Test(preview)를 분리하였습니다.
  • 약간의 보일러플레이트 작성을 줄일 수 있습니다.
import DependenciesMacros

+ @DependencyClient
public struct SomeClient {
    public var doSomething: @Sendable () async throws -> Void
}

- extension DependencyValues {
-  var �someClient: SomeClient {
-    get { self[SomeClient.self] }
-    set { self[SomeClient.self] = newValue }
-  }
- }

FooFeature {
-    @Dependency(\.someClient) var foo
+    @Dependency(SomeClient.self) var foo
}

스크린샷 (선택)

💬리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

close #133

@stealmh stealmh requested a review from ShapeKim98 September 30, 2024 06:14
@stealmh stealmh self-assigned this Sep 30, 2024
@stealmh stealmh added the Refactor 🏗️ 뚝딱뚝딱 코드 및 구조 수정 label Sep 30, 2024
Copy link
Contributor

@ShapeKim98 ShapeKim98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 Dependency를 등록하는 방법도 있군요.. 하나 배워갑니다!
수고하셨습니다!

@stealmh stealmh linked an issue Oct 2, 2024 that may be closed by this pull request
3 tasks
@stealmh stealmh merged commit fbac2fe into develop Oct 2, 2024
1 check passed
@stealmh stealmh deleted the refactor/#133-dependencies branch November 21, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor 🏗️ 뚝딱뚝딱 코드 및 구조 수정
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dependencies 리팩토링
2 participants