Skip to content

Instantly share code, notes, and snippets.

@rajubd49
Created June 20, 2022 09:51
Show Gist options
  • Save rajubd49/21a5485c5f0bd477017bee0da51f74d0 to your computer and use it in GitHub Desktop.
Save rajubd49/21a5485c5f0bd477017bee0da51f74d0 to your computer and use it in GitHub Desktop.
Teufel code review
Code review
12: MusicAlbum struct need to confirm Decodable protocol to decode response from url request
25: Initializer need to have albums initialized with default value like init(albums: [MusicAlbum] = [MusicAlbum]())
29: Function name should be in camel case instead of snake case
30: Url needs to be a valid format, otherwise url session will fail to load response
33: Before sink, we need make sure to publish values from main thread using .received(on: DispatchQueue.main)
34: Need to check completion with .finished and .failure case to show appropriate error message if exists.
37: After line 37, we need to store cancellables instance in specified collection
45: showDetailView needs to be a @State property, otherwise we can’t change it’s value inside struct
61: showDetailView is used to activate navigation link but showDetailView value was not set from anywhere else
63: No data is passed to DetailView to load cover image
89: isLoading is toggled from onAppear only and when we get response or error back from api call we need to toggle it back to show appropriate view state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment