Created
July 17, 2017 06:41
-
-
Save SunXiaoShan/3508c13516c7f3290cd9f2334b64fe77 to your computer and use it in GitHub Desktop.
ThrottleDemo
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
const NSTimeInterval INTERVAL_TIME = 0.5; // 0.5 sec | |
RACSubject *subject = [RACSubject subject]; | |
[[subject throttle:INTERVAL_TIME] subscribeNext:^(id _Nullable x) { | |
NSLog(@"%@",x); | |
}]; | |
[subject sendNext:@1]; | |
[subject sendNext:@2]; | |
[subject sendNext:@3]; | |
[subject sendNext:@4]; | |
// output : 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment