Skip to content

Instantly share code, notes, and snippets.

@lizixroy
Created September 4, 2016 19:46
Show Gist options
  • Save lizixroy/3e3c25f2d72abc1a0ea4cbf23a2a534e to your computer and use it in GitHub Desktop.
Save lizixroy/3e3c25f2d72abc1a0ea4cbf23a2a534e to your computer and use it in GitHub Desktop.
RxSwift-article-3
@warn_unused_result(message="http://git.io/rxs.ud")
public func subscribeNext(onNext: (E) -> Void) -> Disposable {
let observer = AnonymousObserver<E> { e in
if case .Next(let value) = e {
onNext(value)
}
}
return self.subscribeSafe(observer)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment