Expert Combine decisions for iOS/tvOS: when Combine vs async/await, Subject selection trade-offs, operator chain design, and memory management patterns. Use when implementing reactive streams, choosing between concurrency models, or debugging Combine memory leaks. Trigger keywords: Combine, Publisher, Subscriber, Subject, PassthroughSubject, CurrentValueSubject, async/await, AnyCancellable, sink, operators, reactive
View on GitHubKaakati/rails-enterprise-dev
reactree-ios-dev
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/Kaakati/rails-enterprise-dev/blob/main/plugins/reactree-ios-dev/skills/combine-reactive/SKILL.md -a claude-code --skill combine-reactiveInstallation paths:
.claude/skills/combine-reactive/# Combine Reactive — Expert Decisions
Expert decision frameworks for Combine choices. Claude knows Combine syntax — this skill provides judgment calls for when Combine adds value vs async/await and how to avoid common pitfalls.
---
## Decision Trees
### Combine vs Async/Await
```
What's your data flow pattern?
├─ Single async operation (fetch once)
│ └─ async/await
│ Simpler, built into language
│
├─ Stream of values over time
│ └─ Is it UI-driven (user events)?
│ ├─ YES → Combine (debounce, throttle shine here)
│ └─ NO → AsyncSequence may suffice
│
├─ Combining multiple data sources
│ └─ How many sources?
│ ├─ 2-3 → Combine's CombineLatest, Zip
│ └─ Many → Consider structured concurrency (TaskGroup)
│
└─ Existing codebase uses Combine?
└─ Maintain consistency unless migrating
```
**The trap**: Using Combine for simple one-shot async. `async/await` is cleaner and doesn't need cancellable management.
### Subject Type Selection
```
Do you need to access current value?
├─ YES → CurrentValueSubject
│ Can read .value synchronously
│ New subscribers get current value immediately
│
└─ NO → Is it event-based (discrete occurrences)?
├─ YES → PassthroughSubject
│ No stored value, subscribers only get new emissions
│
└─ NO (need replay of past values) →
Consider external state management
Combine has no built-in ReplaySubject
```
### Operator Chain Design
```
What transformation is needed?
├─ Value transformation
│ └─ map (simple), compactMap (filter nils), flatMap (nested publishers)
│
├─ Filtering
│ └─ filter, removeDuplicates, first, dropFirst
│
├─ Timing
│ └─ User input → debounce (wait for pause)
│ Scrolling → throttle (rate limit)
│
├─ Error handling
│ └─ Can provide fallback? → catch, replaceError
│ Need retry? → retry(n)
│
└─ Combining streams
└─ Need all values paired? → zip
Need latest from each? → combineLatest
Merge into one stream? → merge
```
---
## NEVER Do
### Subscripti