You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
1.1 KiB

{"ast":null,"code":"import { Observable } from '../Observable';\nexport function range(start = 0, count, scheduler) {\n return new Observable(subscriber => {\n if (count === undefined) {\n count = start;\n start = 0;\n }\n\n let index = 0;\n let current = start;\n\n if (scheduler) {\n return scheduler.schedule(dispatch, 0, {\n index,\n count,\n start,\n subscriber\n });\n } else {\n do {\n if (index++ >= count) {\n subscriber.complete();\n break;\n }\n\n subscriber.next(current++);\n\n if (subscriber.closed) {\n break;\n }\n } while (true);\n }\n\n return undefined;\n });\n}\nexport function dispatch(state) {\n const {\n start,\n index,\n count,\n subscriber\n } = state;\n\n if (index >= count) {\n subscriber.complete();\n return;\n }\n\n subscriber.next(start);\n\n if (subscriber.closed) {\n return;\n }\n\n state.index = index + 1;\n state.start = start + 1;\n this.schedule(state);\n} //# sourceMappingURL=range.js.map","map":null,"metadata":{},"sourceType":"module"}