Created
June 10, 2016 02:49
-
-
Save bricklife/896bd72ba72123faa26b1056135c3638 to your computer and use it in GitHub Desktop.
ReactiveCocoaにもTestSchedulerがあったけど、RxSwiftのと比べると必要最低限な実装という印象。このコードも期待通りの動きをしない #CodePiece
This file contains 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
import Result | |
import ReactiveCocoa | |
let scheduler = TestScheduler(startDate: NSDate(timeIntervalSince1970: 0)) | |
timer(10, onScheduler: scheduler) | |
.start { _ in print(scheduler.currentDate) } | |
scheduler.advanceByInterval(60) | |
/* | |
1970-01-01 00:01:00 +0000 | |
1970-01-01 00:01:00 +0000 | |
1970-01-01 00:01:00 +0000 | |
1970-01-01 00:01:00 +0000 | |
1970-01-01 00:01:00 +0000 | |
1970-01-01 00:01:00 +0000 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment