The Range operator emits a range of sequential integers, in order, where you select the start of the range and its length.
See Also Language-Specific Information:RxGroovy implements this operator as range
. It accepts as its parameters the start value of the range and the number of items in the range. If you set that number of items to zero, the resulting Observable will emit no values (if you set it to a negative number, range
will cause an exception).
range
does not by default operate on any particular Scheduler, but there is a variant that allows you to set the Scheduler by passing one in as a parameter.
// myObservable emits the integers 5, 6, and 7 before completing: def myObservable = Observable.range(5, 3);
range(int,int)
range(int,int,Scheduler)
RxJava implements this operator as range
. It accepts as its parameters the start value of the range and the number of items in the range. If you set that number of items to zero, the resulting Observable will emit no values (if you set it to a negative number, range
will cause an exception).
range
does not by default operate on any particular Scheduler, but there is a variant that allows you to set the Scheduler by passing one in as a parameter.
range(int,int)
range(int,int,Scheduler)
RxJS implements this operator as range
. It accepts as its parameters the start value of the range and the number of items in the range.
range
operates by default on the currentThread
Scheduler, but there is a variant that allows you to set the Scheduler by passing one in as the optional third parameter.
var source = Rx.Observable.range(0, 3); var subscription = source.subscribe( function (x) { console.log('Next: ' + x); }, function (err) { console.log('Error: ' + err); }, function () { console.log('Completed'); });
Next: 0 Next: 1 Next: 2 Completed
range
is found in each of the following distributions:
rx.js
rx.compat.js
rx.lite.js
rx.lite.compat.js
RxPHP implements this operator as range
.
Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
Sample Code//from https://github.com/ReactiveX/RxPHP/blob/master/demo/range/range.php $observable = \Rx\Observable::range(0, 3); $observable->subscribe($stdoutObserver);
Next value: 0 Next value: 1 Next value: 2 Complete!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4