Return an Observable that emits the most recent items emitted by the source Observable within periodic time intervals.
More...
Return an Observable that emits the most recent items emitted by the source Observable within periodic time intervals.
- Template Parameters
-
Duration | the type of time interval. |
Coordination | the type of the scheduler (optional). |
- Parameters
-
period | the period of time to sample the source observable. |
coordination | the scheduler for the items (optional). |
- Returns
- Observable that emits the most recently emitted item since the previous sampling.
- Sample Code
values.
[](long v) {
printf("OnNext: %ld\n", v);
},
[]() { printf("OnCompleted\n"); });
OnNext: 1
OnNext: 3
OnNext: 5
OnCompleted