Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dixon2018 committed Mar 14, 2022
1 parent 3159bf8 commit ee1d67e
Show file tree
Hide file tree
Showing 47 changed files with 9,309 additions and 1 deletion.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { asyncScheduler } from '../scheduler/async';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function timeInterval(scheduler = asyncScheduler) {\n return operate((source, subscriber) => {\n let last = scheduler.now();\n source.subscribe(createOperatorSubscriber(subscriber, value => {\n const now = scheduler.now();\n const interval = now - last;\n last = now;\n subscriber.next(new TimeInterval(value, interval));\n }));\n });\n}\nexport class TimeInterval {\n constructor(value, interval) {\n this.value = value;\n this.interval = interval;\n }\n\n}","map":{"version":3,"sources":["/Users/randomsoftware/Projects/Training/clean-code/node_modules/rxjs/dist/esm/internal/operators/timeInterval.js"],"names":["asyncScheduler","operate","createOperatorSubscriber","timeInterval","scheduler","source","subscriber","last","now","subscribe","value","interval","next","TimeInterval","constructor"],"mappings":"AAAA,SAASA,cAAT,QAA+B,oBAA/B;AACA,SAASC,OAAT,QAAwB,cAAxB;AACA,SAASC,wBAAT,QAAyC,sBAAzC;AACA,OAAO,SAASC,YAAT,CAAsBC,SAAS,GAAGJ,cAAlC,EAAkD;AACrD,SAAOC,OAAO,CAAC,CAACI,MAAD,EAASC,UAAT,KAAwB;AACnC,QAAIC,IAAI,GAAGH,SAAS,CAACI,GAAV,EAAX;AACAH,IAAAA,MAAM,CAACI,SAAP,CAAiBP,wBAAwB,CAACI,UAAD,EAAcI,KAAD,IAAW;AAC7D,YAAMF,GAAG,GAAGJ,SAAS,CAACI,GAAV,EAAZ;AACA,YAAMG,QAAQ,GAAGH,GAAG,GAAGD,IAAvB;AACAA,MAAAA,IAAI,GAAGC,GAAP;AACAF,MAAAA,UAAU,CAACM,IAAX,CAAgB,IAAIC,YAAJ,CAAiBH,KAAjB,EAAwBC,QAAxB,CAAhB;AACH,KALwC,CAAzC;AAMH,GARa,CAAd;AASH;AACD,OAAO,MAAME,YAAN,CAAmB;AACtBC,EAAAA,WAAW,CAACJ,KAAD,EAAQC,QAAR,EAAkB;AACzB,SAAKD,KAAL,GAAaA,KAAb;AACA,SAAKC,QAAL,GAAgBA,QAAhB;AACH;;AAJqB","sourcesContent":["import { asyncScheduler } from '../scheduler/async';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function timeInterval(scheduler = asyncScheduler) {\n return operate((source, subscriber) => {\n let last = scheduler.now();\n source.subscribe(createOperatorSubscriber(subscriber, (value) => {\n const now = scheduler.now();\n const interval = now - last;\n last = now;\n subscriber.next(new TimeInterval(value, interval));\n }));\n });\n}\nexport class TimeInterval {\n constructor(value, interval) {\n this.value = value;\n this.interval = interval;\n }\n}\n"]},"metadata":{},"sourceType":"module"}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { asyncScheduler } from '../scheduler/async';\nimport { isValidDate } from '../util/isDate';\nimport { operate } from '../util/lift';\nimport { innerFrom } from '../observable/innerFrom';\nimport { createErrorClass } from '../util/createErrorClass';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport const TimeoutError = createErrorClass(_super => function TimeoutErrorImpl(info = null) {\n _super(this);\n\n this.message = 'Timeout has occurred';\n this.name = 'TimeoutError';\n this.info = info;\n});\nexport function timeout(config, schedulerArg) {\n const {\n first,\n each,\n with: _with = timeoutErrorFactory,\n scheduler = schedulerArg !== null && schedulerArg !== void 0 ? schedulerArg : asyncScheduler,\n meta = null\n } = isValidDate(config) ? {\n first: config\n } : typeof config === 'number' ? {\n each: config\n } : config;\n\n if (first == null && each == null) {\n throw new TypeError('No timeout provided.');\n }\n\n return operate((source, subscriber) => {\n let originalSourceSubscription;\n let timerSubscription;\n let lastValue = null;\n let seen = 0;\n\n const startTimer = delay => {\n timerSubscription = executeSchedule(subscriber, scheduler, () => {\n try {\n originalSourceSubscription.unsubscribe();\n innerFrom(_with({\n meta,\n lastValue,\n seen\n })).subscribe(subscriber);\n } catch (err) {\n subscriber.error(err);\n }\n }, delay);\n };\n\n originalSourceSubscription = source.subscribe(createOperatorSubscriber(subscriber, value => {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n seen++;\n subscriber.next(lastValue = value);\n each > 0 && startTimer(each);\n }, undefined, undefined, () => {\n if (!(timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.closed)) {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n }\n\n lastValue = null;\n }));\n !seen && startTimer(first != null ? typeof first === 'number' ? first : +first - scheduler.now() : each);\n });\n}\n\nfunction timeoutErrorFactory(info) {\n throw new TimeoutError(info);\n}","map":{"version":3,"sources":["/Users/randomsoftware/Projects/Training/clean-code/node_modules/rxjs/dist/esm/internal/operators/timeout.js"],"names":["asyncScheduler","isValidDate","operate","innerFrom","createErrorClass","createOperatorSubscriber","executeSchedule","TimeoutError","_super","TimeoutErrorImpl","info","message","name","timeout","config","schedulerArg","first","each","with","_with","timeoutErrorFactory","scheduler","meta","TypeError","source","subscriber","originalSourceSubscription","timerSubscription","lastValue","seen","startTimer","delay","unsubscribe","subscribe","err","error","value","next","undefined","closed","now"],"mappings":"AAAA,SAASA,cAAT,QAA+B,oBAA/B;AACA,SAASC,WAAT,QAA4B,gBAA5B;AACA,SAASC,OAAT,QAAwB,cAAxB;AACA,SAASC,SAAT,QAA0B,yBAA1B;AACA,SAASC,gBAAT,QAAiC,0BAAjC;AACA,SAASC,wBAAT,QAAyC,sBAAzC;AACA,SAASC,eAAT,QAAgC,yBAAhC;AACA,OAAO,MAAMC,YAAY,GAAGH,gBAAgB,CAAEI,MAAD,IAAY,SAASC,gBAAT,CAA0BC,IAAI,GAAG,IAAjC,EAAuC;A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asyncScheduler } from '../scheduler/async';\nimport { isValidDate } from '../util/isDate';\nimport { operate } from '../util/lift';\nimport { innerFrom } from '../observable/innerFrom';\nimport { createErrorClass } from '../util/createErrorClass';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport const TimeoutError = createErrorClass((_super) => function TimeoutErrorImpl(info = null) {\n _super(this);\n this.message = 'Timeout has occurred';\n this.name = 'TimeoutError';\n this.info = info;\n});\nexport function timeout(config, schedulerArg) {\n const { first, each, with: _with = timeoutErrorFactory, scheduler = schedulerArg !== null && schedulerArg !== void 0 ? schedulerArg : asyncScheduler, meta = null, } = (isValidDate(config) ? { first: config } : typeof config === 'number' ? { each: config } : config);\n if (first == null && each == null) {\n throw new TypeError('No timeout provided.');\n }\n return operate((source, subscriber) => {\n let originalSourceSubscription;\n let timerSubscription;\n let lastValue = null;\n let seen = 0;\n const startTimer = (delay) => {\n timerSubscription = executeSchedule(subscriber, scheduler, () => {\n try {\n originalSourceSubscription.unsubscribe();\n innerFrom(_with({\n meta,\n lastValue,\n seen,\n })).subscribe(subscriber);\n }\n catch (err) {\n subscriber.error(err);\n }\n }, delay);\n };\n originalSourceSubscription = source.subscribe(createOperatorSubscriber(subscriber, (value) => {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n seen++;\n subscriber.next((lastValue = value));\n each > 0 && startTimer(each);\n }, undefined, undefined, () => {\n if (!(timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.closed)) {\n timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();\n }\n lastValue = null;\n }));\n !seen && startTimer(first != null ? (typeof first === 'number' ? first : +first - scheduler.now()) : each);\n });\n}\nfunction timeoutErrorFactory(info) {\n throw new TimeoutError(info);\n}\n"]},"metadata":{},"sourceType":"module"}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { Observable } from '../Observable';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleAsyncIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n\n return new Observable(subscriber => {\n executeSchedule(subscriber, scheduler, () => {\n const iterator = input[Symbol.asyncIterator]();\n executeSchedule(subscriber, scheduler, () => {\n iterator.next().then(result => {\n if (result.done) {\n subscriber.complete();\n } else {\n subscriber.next(result.value);\n }\n });\n }, 0, true);\n });\n });\n}","map":{"version":3,"sources":["/Users/randomsoftware/Projects/Training/clean-code/node_modules/rxjs/dist/esm/internal/scheduled/scheduleAsyncIterable.js"],"names":["Observable","executeSchedule","scheduleAsyncIterable","input","scheduler","Error","subscriber","iterator","Symbol","asyncIterator","next","then","result","done","complete","value"],"mappings":"AAAA,SAASA,UAAT,QAA2B,eAA3B;AACA,SAASC,eAAT,QAAgC,yBAAhC;AACA,OAAO,SAASC,qBAAT,CAA+BC,KAA/B,EAAsCC,SAAtC,EAAiD;AACpD,MAAI,CAACD,KAAL,EAAY;AACR,UAAM,IAAIE,KAAJ,CAAU,yBAAV,CAAN;AACH;;AACD,SAAO,IAAIL,UAAJ,CAAgBM,UAAD,IAAgB;AAClCL,IAAAA,eAAe,CAACK,UAAD,EAAaF,SAAb,EAAwB,MAAM;AACzC,YAAMG,QAAQ,GAAGJ,KAAK,CAACK,MAAM,CAACC,aAAR,CAAL,EAAjB;AACAR,MAAAA,eAAe,CAACK,UAAD,EAAaF,SAAb,EAAwB,MAAM;AACzCG,QAAAA,QAAQ,CAACG,IAAT,GAAgBC,IAAhB,CAAsBC,MAAD,IAAY;AAC7B,cAAIA,MAAM,CAACC,IAAX,EAAiB;AACbP,YAAAA,UAAU,CAACQ,QAAX;AACH,WAFD,MAGK;AACDR,YAAAA,UAAU,CAACI,IAAX,CAAgBE,MAAM,CAACG,KAAvB;AACH;AACJ,SAPD;AAQH,OATc,EASZ,CATY,EAST,IATS,CAAf;AAUH,KAZc,CAAf;AAaH,GAdM,CAAP;AAeH","sourcesContent":["import { Observable } from '../Observable';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function scheduleAsyncIterable(input, scheduler) {\n if (!input) {\n throw new Error('Iterable cannot be null');\n }\n return new Observable((subscriber) => {\n executeSchedule(subscriber, scheduler, () => {\n const iterator = input[Symbol.asyncIterator]();\n executeSchedule(subscriber, scheduler, () => {\n iterator.next().then((result) => {\n if (result.done) {\n subscriber.complete();\n }\n else {\n subscriber.next(result.value);\n }\n });\n }, 0, true);\n });\n });\n}\n"]},"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { Observable } from '../Observable';\nimport { async as asyncScheduler } from '../scheduler/async';\nimport { isScheduler } from '../util/isScheduler';\nimport { isValidDate } from '../util/isDate';\nexport function timer(dueTime = 0, intervalOrScheduler, scheduler = asyncScheduler) {\n let intervalDuration = -1;\n\n if (intervalOrScheduler != null) {\n if (isScheduler(intervalOrScheduler)) {\n scheduler = intervalOrScheduler;\n } else {\n intervalDuration = intervalOrScheduler;\n }\n }\n\n return new Observable(subscriber => {\n let due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;\n\n if (due < 0) {\n due = 0;\n }\n\n let n = 0;\n return scheduler.schedule(function () {\n if (!subscriber.closed) {\n subscriber.next(n++);\n\n if (0 <= intervalDuration) {\n this.schedule(undefined, intervalDuration);\n } else {\n subscriber.complete();\n }\n }\n }, due);\n });\n}","map":{"version":3,"sources":["/Users/randomsoftware/Projects/Training/clean-code/node_modules/rxjs/dist/esm/internal/observable/timer.js"],"names":["Observable","async","asyncScheduler","isScheduler","isValidDate","timer","dueTime","intervalOrScheduler","scheduler","intervalDuration","subscriber","due","now","n","schedule","closed","next","undefined","complete"],"mappings":"AAAA,SAASA,UAAT,QAA2B,eAA3B;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,oBAAxC;AACA,SAASC,WAAT,QAA4B,qBAA5B;AACA,SAASC,WAAT,QAA4B,gBAA5B;AACA,OAAO,SAASC,KAAT,CAAeC,OAAO,GAAG,CAAzB,EAA4BC,mBAA5B,EAAiDC,SAAS,GAAGN,cAA7D,EAA6E;AAChF,MAAIO,gBAAgB,GAAG,CAAC,CAAxB;;AACA,MAAIF,mBAAmB,IAAI,IAA3B,EAAiC;AAC7B,QAAIJ,WAAW,CAACI,mBAAD,CAAf,EAAsC;AAClCC,MAAAA,SAAS,GAAGD,mBAAZ;AACH,KAFD,MAGK;AACDE,MAAAA,gBAAgB,GAAGF,mBAAnB;AACH;AACJ;;AACD,SAAO,IAAIP,UAAJ,CAAgBU,UAAD,IAAgB;AAClC,QAAIC,GAAG,GAAGP,WAAW,CAACE,OAAD,CAAX,GAAuB,CAACA,OAAD,GAAWE,SAAS,CAACI,GAAV,EAAlC,GAAoDN,OAA9D;;AACA,QAAIK,GAAG,GAAG,CAAV,EAAa;AACTA,MAAAA,GAAG,GAAG,CAAN;AACH;;AACD,QAAIE,CAAC,GAAG,CAAR;AACA,WAAOL,SAAS,CAACM,QAAV,CAAmB,YAAY;AAClC,UAAI,CAACJ,UAAU,CAACK,MAAhB,EAAwB;AACpBL,QAAAA,UAAU,CAACM,IAAX,CAAgBH,CAAC,EAAjB;;AACA,YAAI,KAAKJ,gBAAT,EAA2B;AACvB,eAAKK,QAAL,CAAcG,SAAd,EAAyBR,gBAAzB;AACH,SAFD,MAGK;AACDC,UAAAA,UAAU,CAACQ,QAAX;AACH;AACJ;AACJ,KAVM,EAUJP,GAVI,CAAP;AAWH,GAjBM,CAAP;AAkBH","sourcesContent":["import { Observable } from '../Observable';\nimport { async as asyncScheduler } from '../scheduler/async';\nimport { isScheduler } from '../util/isScheduler';\nimport { isValidDate } from '../util/isDate';\nexport function timer(dueTime = 0, intervalOrScheduler, scheduler = asyncScheduler) {\n let intervalDuration = -1;\n if (intervalOrScheduler != null) {\n if (isScheduler(intervalOrScheduler)) {\n scheduler = intervalOrScheduler;\n }\n else {\n intervalDuration = intervalOrScheduler;\n }\n }\n return new Observable((subscriber) => {\n let due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;\n if (due < 0) {\n due = 0;\n }\n let n = 0;\n return scheduler.schedule(function () {\n if (!subscriber.closed) {\n subscriber.next(n++);\n if (0 <= intervalDuration) {\n this.schedule(undefined, intervalDuration);\n }\n else {\n subscriber.complete();\n }\n }\n }, due);\n });\n}\n"]},"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\nexport const async = asyncScheduler;","map":{"version":3,"sources":["/Users/randomsoftware/Projects/Training/clean-code/node_modules/rxjs/dist/esm/internal/scheduler/async.js"],"names":["AsyncAction","AsyncScheduler","asyncScheduler","async"],"mappings":"AAAA,SAASA,WAAT,QAA4B,eAA5B;AACA,SAASC,cAAT,QAA+B,kBAA/B;AACA,OAAO,MAAMC,cAAc,GAAG,IAAID,cAAJ,CAAmBD,WAAnB,CAAvB;AACP,OAAO,MAAMG,KAAK,GAAGD,cAAd","sourcesContent":["import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport const asyncScheduler = new AsyncScheduler(AsyncAction);\nexport const async = asyncScheduler;\n"]},"metadata":{},"sourceType":"module"}
Loading

0 comments on commit ee1d67e

Please sign in to comment.