Debounced search in Combine: debounce, removeDuplicates, switchToLatest
The gist
Search-as-you-type is the canonical Combine task: turn a stream of keystrokes into a stream of up-to-date results. Each operator solves its own problem: debounce waits for a pause in typing, removeDuplicates drops a repeat of the same query, map turns a string into a network publisher, switchToLatest cancels the stale request, receive(on:) delivers the result on main.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep