Publisher
Just
: 發送單一值並隨後完成的 Publisher。Empty
: 只發送完成事件,不發送任何值。Fail
: 發送失敗事件,不發送任何值。Subscription Operators
subscribe(on:)
: 指定上游 Publisher 在哪個排程器上運行。receive(on:)
: 指定下游 Subscriber 在哪個排程器上接收數據。map(:)
flatMap(maxPublishers:_:)
replaceNil(with:)
nil
值替換成指定的值。replaceEmpty(with:)
scan(::)
reduce
操作,一次處理一個值並將結果累積。filter(_:)
removeDuplicates()
compactMap(_:)
nil
值。first(where:)
dropFirst(_:)
merge(with:)
combineLatest(::)
zip(::)
switchToLatest()
delay(for:tolerance:scheduler:)
throttle(for:scheduler:latest:)
debounce(for:scheduler:)
collect()
sink(receiveCompletion:receiveValue:)