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

Spotify Example #101

Merged
merged 9 commits into from
Sep 12, 2024
Merged

Spotify Example #101

merged 9 commits into from
Sep 12, 2024

Conversation

danthorpe
Copy link
Owner

@danthorpe danthorpe commented Sep 12, 2024

This PR adds an example application, built using swift-networking and swift-composable-loadable. It showcases the following approach:

  1. Imports Networking, NetworkingClient and NetworkingClientLive
    • Ideally, in a production app only the final app target would depend on NetworkingClientLive
  2. Creates a new dependency using @DependencyClient for a SpotifyClient.
  3. The Spotify.Client separates the "Spotify API" aspect from the networking by making use of Spotify.api static value.
    • This uses @Dependency(\.networkClient) as its starting point, before adding Spotify related configuration.
    • This configuration includes setting up OAuth parameters using a Spotify App which I've already created - although this is still in development mode.
  4. The Spotify.Client provides an API to perform actions such as sign in, sign out, listen for credentials changing, setting existing credentials, as well as fetching resources such as the user profile.
  5. The app is built using TCA, and the AppFeature handles sign in/out & credentials.
  6. Once signed in, the app will show the user's followed artists. This is done using Loadable and Paginating components from swift-composable-loadable.

@codecov-commenter
Copy link

codecov-commenter commented Sep 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.06%. Comparing base (930dc0c) to head (cadb49a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #101   +/-   ##
=======================================
  Coverage   82.05%   82.06%           
=======================================
  Files          92       92           
  Lines        2012     2013    +1     
=======================================
+ Hits         1651     1652    +1     
  Misses        361      361           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@danthorpe danthorpe merged commit 0cca90e into main Sep 12, 2024
3 checks passed
@danthorpe danthorpe deleted the spotify_demo branch September 12, 2024 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants