Skip to content

Commit

Permalink
Add DependencyClient macro description
Browse files Browse the repository at this point in the history
  • Loading branch information
kalupas226 committed Feb 27, 2024
1 parent 209e6a5 commit 5cc9155
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
`UserDefaultsClient` の実装については、Point-Free が開発している TCA 製のゲームアプリである [isowords のコード](https://github.com/pointfreeco/isowords/tree/40d59a899bbe54810bb0d7af0f3b72379c56bafb/Sources/UserDefaultsClient)に参考になる部分があると思います。

また、現状 `GitHubAPIClient` は GitHub の PAT を `Bundle.main.infoDictionary` から直接取得する実装となっていますが、この取得部分も `@Dependency` として管理することができます。取得部分を `BuildConfig/Client.swift` に実装してみましょう。
さらに、[この Discussion](https://github.com/pointfreeco/swift-composable-architecture/discussions/1858) などを参考に、作成した `@Dependency` を `GitHubAPIClient` で利用するように修正してみましょう
さらに、[この Discussion](https://github.com/pointfreeco/swift-composable-architecture/discussions/1858) などを参考に、作成した `@Dependency` を `GitHubAPIClient` で利用するように修正したり、swift-dependencies に用意されている [@DependencyClient](https://swiftpackageindex.com/pointfreeco/swift-dependencies/main/documentation/dependencies/designingdependencies#DependencyClient-macro) macro を Client で利用するように書き換えてみましょう

@Image(source: "08-image-01.gif", alt: "リポジトリ詳細画面のお気に入り機能の図")
}
Expand Down

0 comments on commit 5cc9155

Please sign in to comment.