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.

21 lines
551 B

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 E: Equatable {
  11. public func ignore(_ valuesToIgnore: E ...) -> Observable<E> {
  12. return self.asObservable().filter { !valuesToIgnore.contains($0) }
  13. }
  14. public func ignore<S: Sequence>(_ valuesToIgnore: S) -> Observable<E> where S.Iterator.Element == E {
  15. return self.asObservable().filter { !valuesToIgnore.contains($0) }
  16. }
  17. }