You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
597 B

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. //
  2. // ignore.swift
  3. // RxSwiftExt
  4. //
  5. // Created by Florent Pillet on 10/04/16.
  6. // Copyright © 2016 RxSwift Community. All rights reserved.
  7. //
  8. import Foundation
  9. import RxSwift
  10. extension ObservableType where Element: Equatable {
  11. public func ignore(_ valuesToIgnore: Element...) -> Observable<Element> {
  12. return self.asObservable().filter { !valuesToIgnore.contains($0) }
  13. }
  14. public func ignore<Sequence: Swift.Sequence>(_ valuesToIgnore: Sequence) -> Observable<Element> where Sequence.Element == Element {
  15. return self.asObservable().filter { !valuesToIgnore.contains($0) }
  16. }
  17. }