Every new change
This commit is contained in:
48
node_modules/rxjs/_esm5/internal/observable/range.js
generated
vendored
Normal file
48
node_modules/rxjs/_esm5/internal/observable/range.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
|
||||
import { Observable } from '../Observable';
|
||||
export function range(start, count, scheduler) {
|
||||
if (start === void 0) {
|
||||
start = 0;
|
||||
}
|
||||
return new Observable(function (subscriber) {
|
||||
if (count === undefined) {
|
||||
count = start;
|
||||
start = 0;
|
||||
}
|
||||
var index = 0;
|
||||
var current = start;
|
||||
if (scheduler) {
|
||||
return scheduler.schedule(dispatch, 0, {
|
||||
index: index, count: count, start: start, subscriber: subscriber
|
||||
});
|
||||
}
|
||||
else {
|
||||
do {
|
||||
if (index++ >= count) {
|
||||
subscriber.complete();
|
||||
break;
|
||||
}
|
||||
subscriber.next(current++);
|
||||
if (subscriber.closed) {
|
||||
break;
|
||||
}
|
||||
} while (true);
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
export function dispatch(state) {
|
||||
var start = state.start, index = state.index, count = state.count, subscriber = state.subscriber;
|
||||
if (index >= count) {
|
||||
subscriber.complete();
|
||||
return;
|
||||
}
|
||||
subscriber.next(start);
|
||||
if (subscriber.closed) {
|
||||
return;
|
||||
}
|
||||
state.index = index + 1;
|
||||
state.start = start + 1;
|
||||
this.schedule(state);
|
||||
}
|
||||
//# sourceMappingURL=range.js.map
|
Reference in New Issue
Block a user