Combine zip vs combineLatest
Write a Combine pipeline that sends two different network requests (user profile, account list) at the same time and emits a result once, only when both have completed. Would you use zip or combineLatest, and why?
Write a Combine pipeline that sends two different network requests (user profile, account list) at the same time and emits a result once, only when both have completed. Would you use zip or combineLatest, and why?
Use zip to pair two one-shot requests. zip matches the nth value from each upstream and emits once, only when both have arrived, while combineLatest re-emits the latest combination whenever either side changes after both have emitted once, so the meaning differs. Zip the profile and accounts publishers, map them into a dashboard model, receive on main, and sink.
ConcurrencyShort answerBasics
When a screen appears you call three APIs in parallel, profile, feed, and notifications…
#async-let
ConcurrencyMultiple choiceAdvanced
Which of the following statements about structured concurrency (async let, TaskGroup) are…
#async-let
ConcurrencyMultiple choiceBasics
You want to call the API once, 300ms after typing stops, instead of on every keystroke in…
#combine
ConcurrencyMultiple choiceIntro
In Swift Concurrency, if fetchProfile() and fetchFeed() each take 1 second, which…
#async-let