Created
March 5, 2019 09:03
-
-
Save pzmudzinski/9ac4e59987c61131c793efbdbecce75c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Observable { | |
func rebound(after interval: RxTimeInterval, map: @escaping (Element) -> Element = { return $0 }) -> Observable<Element> { | |
return flatMap { element in | |
return Observable.just(map(element)) | |
.delay(interval, scheduler: MainScheduler.instance) | |
.startWith(element) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment