-
Notifications
You must be signed in to change notification settings - Fork 130
Files
/
Copy pathoperators.csv
71 lines (71 loc) · 2.25 KB
/
operators.csv
1 | RxSwift | Combine | Notes |
---|---|---|---|
2 | amb() | ❌ | |
3 | asObservable() | eraseToAnyPublisher() | |
4 | asObserver() | ❌ | |
5 | bind(to:) | `assign(to:on:)` | Assign uses a KeyPath which is really nice and useful. RxSwift needs a Binder / ObserverType to bind to. |
6 | buffer | buffer | |
7 | catchError | catch | |
8 | catchErrorJustReturn | replaceError(with:) | |
9 | combineLatest | combineLatest, tryCombineLatest | |
10 | compactMap | compactMap, tryCompactMap | |
11 | concat | append, prepend | |
12 | concatMap | ❌ | |
13 | create | ❌ | Apple removed AnyPublisher with a closure in Xcode 11 beta 3 :-( |
14 | debounce | debounce | |
15 | debug | ||
16 | deferred | Deferred | |
17 | delay | delay | |
18 | delaySubscription | ❌ | |
19 | dematerialize | ❌ | |
20 | distinctUntilChanged | removeDuplicates, tryRemoveDuplicates | |
21 | do | handleEvents | |
22 | elementAt | output(at:) | |
23 | empty | Empty(completeImmediately: true) | |
24 | enumerated | ❌ | |
25 | error | Fail | |
26 | filter | filter, tryFilter | |
27 | first | first, tryFirst | |
28 | flatMap | flatMap | |
29 | flatMapFirst | ❌ | |
30 | flatMapLatest | switchToLatest | |
31 | from(optional:) | Optional.Publisher(_ output:) | |
32 | groupBy | ❌ | |
33 | ifEmpty(default:) | replaceEmpty(with:) | |
34 | ifEmpty(switchTo:) | ❌ | Could be achieved with composition - replaceEmpty(with: publisher).switchToLatest() |
35 | ignoreElements | ignoreOutput | |
36 | interval | ❌ | |
37 | just | Just | |
38 | map | map, tryMap | |
39 | materialize | ❌ | |
40 | merge | merge, tryMerge | |
41 | merge(maxConcurrent:) | flatMap(maxPublishers:) | |
42 | multicast | multicast | |
43 | never | Empty(completeImmediately: false) | |
44 | observeOn | receive(on:) | |
45 | of | Sequence.publisher | `publisher` property on any `Sequence` or you can use `Publishers.Sequence(sequence:)` directly |
46 | publish | makeConnectable | |
47 | range | ❌ | |
48 | reduce | reduce, tryReduce | |
49 | refCount | autoconnect | |
50 | repeatElement | ❌ | |
51 | retry, retry(3) | retry, retry(3) | |
52 | retryWhen | ❌ | |
53 | sample | ❌ | |
54 | scan | scan, tryScan | |
55 | share | share | There’s no replay or scope in Combine. Could be “faked” with multicast. |
56 | skip(3) | dropFirst(3) | |
57 | skipUntil | drop(untilOutputFrom:) | |
58 | skipWhile | drop(while:), tryDrop(while:) | |
59 | startWith | prepend | |
60 | subscribe | sink | |
61 | subscribeOn | subscribe(on:) | RxSwift uses Schedulers. Combine uses RunLoop, DispatchQueue, and OperationQueue. |
62 | take(1) | prefix(1) | |
63 | takeLast | last | |
64 | takeUntil | prefix(untilOutputFrom:) | |
65 | throttle | throttle | |
66 | timeout | timeout | |
67 | timer | Timer.publish | |
68 | toArray() | collect() | |
69 | window | collect(Publishers.TimeGroupingStrategy) | Combine has a TimeGroupingStrategy.byTimeOrCount that could be used as a window. |
70 | withLatestFrom | ❌ | |
71 | zip | zip |