(_ transform: @escaping (Output) -> P) -> Publishers.SwitchToLatest> {
25 | map(transform).switchToLatest()
26 | }
27 | }
28 | #endif
29 |
--------------------------------------------------------------------------------
/Sources/Operators/IgnoreFailure.swift:
--------------------------------------------------------------------------------
1 | //
2 | // IgnoreFailure.swift
3 | // CombineExt
4 | //
5 | // Created by Jasdev Singh on 17/10/2020.
6 | // Copyright © 2020 Combine Community. All rights reserved.
7 | //
8 |
9 | #if canImport(Combine)
10 | import Combine
11 |
12 | @available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
13 | public extension Publisher {
14 | /// An analog to `ignoreOutput` for `Publisher`’s `Failure` generic, allowing for either no or an immediate completion on an error event.
15 | ///
16 | /// - parameter completeImmediately: Whether the returned publisher should complete on an error event. Defaults to `true`.
17 | ///
18 | /// - returns: A publisher that ignores upstream error events.
19 | func ignoreFailure(completeImmediately: Bool = true) -> AnyPublisher