Skip to content
Check element in Stream
Swift Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example
RxAssert
.gitignore
.travis.yml
LICENSE
Package.swift
README.md
RxAssert.podspec
_Pods.xcodeproj

README.md

RxAssert

CI Status Version License Platform

Usage

Check element in Stream

extension Observable {

    public func assert(message: String = default, _ condition: (Event<E>) -> Bool) -> RxSwift.Observable<Element>

    public func assertNext(message: String = default, _ condition: (E) -> Bool) -> RxSwift.Observable<Element>
}

extension Driver {

    public func assert(message: String = default, _ condition: (Event<E>) -> Bool) -> RxCocoa.Driver<Element>

    public func assertNext(message: String = default, _ condition: (E) -> Bool) -> RxCocoa.Driver<Element>
}
  • Sample1
name
  .assertNext("invalid name") { $0 != "muukii" }
  .subscribe()
  • Sample2
name
  .assert("Don't send error") { event in
    if case .Error = event {
      return false
    }
    return true
  }
  .subscribe()

Requirements

Installation

RxAssert is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RxAssert"

Author

muukii, m@muukii.me

License

RxAssert is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.