Skip to content

Files

Latest commit

 

History

History
71 lines (71 loc) · 2.25 KB

operators.csv

File metadata and controls

71 lines (71 loc) · 2.25 KB
1
RxSwiftCombineNotes
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
bufferbuffer
7
catchErrorcatch
8
catchErrorJustReturnreplaceError(with:)
9
combineLatestcombineLatest, tryCombineLatest
10
compactMapcompactMap, tryCompactMap
11
concatappend, prepend
12
concatMap
13
createApple removed AnyPublisher with a closure in Xcode 11 beta 3 :-(
14
debouncedebounce
15
debugprint
16
deferredDeferred
17
delaydelay
18
delaySubscription
19
dematerialize
20
distinctUntilChangedremoveDuplicates, tryRemoveDuplicates
21
dohandleEvents
22
elementAtoutput(at:)
23
emptyEmpty(completeImmediately: true)
24
enumerated
25
errorFail
26
filterfilter, tryFilter
27
firstfirst, tryFirst
28
flatMapflatMap
29
flatMapFirst
30
flatMapLatestswitchToLatest
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
ignoreElementsignoreOutput
36
interval
37
justJust
38
mapmap, tryMap
39
materialize
40
mergemerge, tryMerge
41
merge(maxConcurrent:)flatMap(maxPublishers:)
42
multicastmulticast
43
neverEmpty(completeImmediately: false)
44
observeOnreceive(on:)
45
ofSequence.publisher`publisher` property on any `Sequence` or you can use `Publishers.Sequence(sequence:)` directly
46
publishmakeConnectable
47
range
48
reducereduce, tryReduce
49
refCountautoconnect
50
repeatElement
51
retry, retry(3)retry, retry(3)
52
retryWhen
53
sample
54
scanscan, tryScan
55
shareshareThere’s no replay or scope in Combine. Could be “faked” with multicast.
56
skip(3)dropFirst(3)
57
skipUntildrop(untilOutputFrom:)
58
skipWhiledrop(while:), tryDrop(while:)
59
startWithprepend
60
subscribesink
61
subscribeOnsubscribe(on:)RxSwift uses Schedulers. Combine uses RunLoop, DispatchQueue, and OperationQueue.
62
take(1)prefix(1)
63
takeLastlast
64
takeUntilprefix(untilOutputFrom:)
65
throttlethrottle
66
timeouttimeout
67
timerTimer.publish
68
toArray()collect()
69
windowcollect(Publishers.TimeGroupingStrategy)Combine has a TimeGroupingStrategy.byTimeOrCount that could be used as a window.
70
withLatestFrom
71
zipzip