How to use the range function from rxjs
Find comprehensive JavaScript rxjs.range code examples handpicked from public code repositorys.
GitHub: openforis/sepal
123 124 125 126 127 128 129 130 131 132
} }), retryWhen(function (error$) { return zip( error$, range(1, retries + 1) ).pipe( mergeMap( ([error, retry]) => { if (error.statusCode < 500 || retry > retries)
45
178
34
GitHub: imooc-lego/students-learn-task
165 166 167 168 169 170 171 172 173 174
类似**Promise** ``` const { range } = require('rxjs'); const { map, filter } = require('rxjs/operators'); const pipe = range(1, 200).pipe( filter(x => x % 2 === 1), map(x => x + x), filter(x => x % 3 === 0), filter(x => x % 6 === 0),
197
58
3
71 72 73 74 75 76 77 78 79 80
this.percentageHomeDelivery = (percentageHomeDelivery || 0) / 100 || 0.15 // based on guestimates from workshop with transport actors in oct 2021 this.percentageReturnDelivery = 0.1 this.kommun = kommun this.cars = from(Object.entries(vehicles)).pipe( mergeMap(([type, count]) => range(0, count).pipe( mergeMap(() => { const Vehicle = vehicleTypes[type].class return of(
1
16
0
GitHub: visualkhh/pro-game
78 79 80 81 82 83 84 85 86 87
// const keys = Object.keys(essenceManager); // const values = keys.map(key => `${key}: ${Reflect.get(essenceManager, key)}`); // console.log(values); // range(1, 200).pipe( // filter((x: any) => x % 2 === 1), // map((x: any) => x + x) // ).subscribe((x: any) => { // console.log(x);
0
3
3
+ 3 other calls in file
GitHub: USU-Robosub/submarine
1 2 3 4 5 6 7 8 9 10
const { finalize, first, skip, map, concatMap, take, mergeMap, toArray, delay } = require('rxjs/operators') const { pipe, merge, concat, interval, range, of, Observable, timer, from } = require('rxjs') const sequential = (...commands) => { let base = range(0, commands.length) const command = { ...Command().action( (system, scheduler) => base.pipe( take(commands.length),
0
1
7
+ 5 other calls in file
GitHub: caosbad/api
60 61 62 63 64 65 66 67 68 69
exports.of = rxjs.of; exports.onErrorResumeNext = rxjs.onErrorResumeNext; exports.pairs = rxjs.pairs; exports.partition = rxjs.partition; exports.race = rxjs.race; exports.range = rxjs.range; exports.throwError = rxjs.throwError; exports.timer = rxjs.timer; exports.using = rxjs.using; exports.zip = rxjs.zip;
299
0
1
277 278 279 280 281 282 283 284 285 286
if((!(client || {}).location || {}).lng){ this.sendTextMessage(`El satelite no tiene la ubicación configurada, por favor comunicarse con soporte `, conversationContent.waId) return of({}); } else if (availableServices >= 0 && availableServices <= 5) { return range(1, servicesToRequest).pipe( mergeMap(() => { const acEnabled = (specialServiceToRqstCountVal--) > 0; const airportTipEnabled = (airportCharCountVal--) > 0; return eventSourcing.eventStore.emitEvent$(this.buildServiceRequestedEsEvent(client, acEnabled, airportTipEnabled));
0
0
5
+ 391 other calls in file
64 65 66 67 68 69 70 71 72 73
} const today = new Date(new Date().toLocaleString('es-CO', { timeZone: 'America/Bogota' })); const explorePastMonth = today.getDate() <= 1; return range(explorePastMonth ? -1 : 0, explorePastMonth ? 2 : 1) .pipe( map(monthsToAdd => mongoDB.getHistoricalDb(undefined, monthsToAdd)), map(db => db.collection(COLLECTION_NAME)), mergeMap(collection => {
0
0
5
+ 82 other calls in file