Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10 components #255

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 { operate } from '../util/lift';\nimport { innerFrom } from '../observable/innerFrom';\nimport { argsOrArgArray } from '../util/argsOrArgArray';\nimport { OperatorSubscriber } from './OperatorSubscriber';\nimport { noop } from '../util/noop';\nexport function onErrorResumeNext(...sources) {\n const nextSources = argsOrArgArray(sources);\n return operate((source, subscriber) => {\n const remaining = [source, ...nextSources];\n\n const subscribeNext = () => {\n if (!subscriber.closed) {\n if (remaining.length > 0) {\n let nextSource;\n\n try {\n nextSource = innerFrom(remaining.shift());\n } catch (err) {\n subscribeNext();\n return;\n }\n\n const innerSub = new OperatorSubscriber(subscriber, undefined, noop, noop);\n subscriber.add(nextSource.subscribe(innerSub));\n innerSub.add(subscribeNext);\n } else {\n subscriber.complete();\n }\n }\n };\n\n subscribeNext();\n });\n} //# sourceMappingURL=onErrorResumeNext.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { Subscription } from '../Subscription';\nexport class Action extends Subscription {\n constructor(scheduler, work) {\n super();\n }\n\n schedule(state, delay = 0) {\n return this;\n }\n\n} //# sourceMappingURL=Action.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { exhaustAll } from './exhaustAll';\nexport const exhaust = exhaustAll; //# sourceMappingURL=exhaust.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { Observable } from '../Observable';\nimport { isFunction } from '../util/isFunction';\nexport function throwError(errorOrErrorFactory, scheduler) {\n const errorFactory = isFunction(errorOrErrorFactory) ? errorOrErrorFactory : () => errorOrErrorFactory;\n\n const init = subscriber => subscriber.error(errorFactory());\n\n return new Observable(scheduler ? subscriber => scheduler.schedule(init, 0, subscriber) : init);\n} //# sourceMappingURL=throwError.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { mergeMap } from './mergeMap';\nimport { isFunction } from '../util/isFunction';\nexport function mergeMapTo(innerObservable, resultSelector, concurrent = Infinity) {\n if (isFunction(resultSelector)) {\n return mergeMap(() => innerObservable, resultSelector, concurrent);\n }\n\n if (typeof resultSelector === 'number') {\n concurrent = resultSelector;\n }\n\n return mergeMap(() => innerObservable, concurrent);\n} //# sourceMappingURL=mergeMapTo.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { operate } from '../util/lift';\nimport { OperatorSubscriber } from './OperatorSubscriber';\nexport function refCount() {\n return operate((source, subscriber) => {\n let connection = null;\n source._refCount++;\n const refCounter = new OperatorSubscriber(subscriber, undefined, undefined, undefined, () => {\n if (!source || source._refCount <= 0 || 0 < --source._refCount) {\n connection = null;\n return;\n }\n\n const sharedConnection = source._connection;\n const conn = connection;\n connection = null;\n\n if (sharedConnection && (!conn || sharedConnection === conn)) {\n sharedConnection.unsubscribe();\n }\n\n subscriber.unsubscribe();\n });\n source.subscribe(refCounter);\n\n if (!refCounter.closed) {\n connection = source.connect();\n }\n });\n} //# sourceMappingURL=refCount.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { operate } from '../util/lift';\nimport { OperatorSubscriber } from './OperatorSubscriber';\nimport { innerFrom } from '../observable/innerFrom';\nexport const defaultThrottleConfig = {\n leading: true,\n trailing: false\n};\nexport function throttle(durationSelector, {\n leading,\n trailing\n} = defaultThrottleConfig) {\n return operate((source, subscriber) => {\n let hasValue = false;\n let sendValue = null;\n let throttled = null;\n let isComplete = false;\n\n const endThrottling = () => {\n throttled === null || throttled === void 0 ? void 0 : throttled.unsubscribe();\n throttled = null;\n\n if (trailing) {\n send();\n isComplete && subscriber.complete();\n }\n };\n\n const cleanupThrottling = () => {\n throttled = null;\n isComplete && subscriber.complete();\n };\n\n const startThrottle = value => throttled = innerFrom(durationSelector(value)).subscribe(new OperatorSubscriber(subscriber, endThrottling, cleanupThrottling));\n\n const send = () => {\n if (hasValue) {\n hasValue = false;\n const value = sendValue;\n sendValue = null;\n subscriber.next(value);\n !isComplete && startThrottle(value);\n }\n };\n\n source.subscribe(new OperatorSubscriber(subscriber, value => {\n hasValue = true;\n sendValue = value;\n !(throttled && !throttled.closed) && (leading ? send() : startThrottle(value));\n }, () => {\n isComplete = true;\n !(trailing && hasValue && throttled && !throttled.closed) && subscriber.complete();\n }));\n });\n} //# sourceMappingURL=throttle.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"export function isFunction(value) {\n return typeof value === 'function';\n} //# sourceMappingURL=isFunction.js.map","map":null,"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; //# sourceMappingURL=async.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { zip } from './zip';\nexport function zipWith(...otherInputs) {\n return zip(...otherInputs);\n} //# sourceMappingURL=zipWith.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"export function identity(x) {\n return x;\n} //# sourceMappingURL=identity.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { EventEmitter } from '@angular/core';\nimport * as i0 from \"@angular/core\";\nexport let MenuBtnComponent = /*#__PURE__*/(() => {\n class MenuBtnComponent {\n constructor() {\n this.name = '';\n this.resetGame = new EventEmitter();\n }\n\n btnResetGame() {\n this.resetGame.emit();\n }\n\n }\n\n MenuBtnComponent.ɵfac = function MenuBtnComponent_Factory(t) {\n return new (t || MenuBtnComponent)();\n };\n\n MenuBtnComponent.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n type: MenuBtnComponent,\n selectors: [[\"app-menu-btn\"]],\n inputs: {\n name: \"name\"\n },\n outputs: {\n resetGame: \"resetGame\"\n },\n decls: 2,\n vars: 1,\n consts: [[\"type\", \"button\", 1, \"game__menu-btn\", 3, \"click\"]],\n template: function MenuBtnComponent_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"button\", 0);\n i0.ɵɵlistener(\"click\", function MenuBtnComponent_Template_button_click_0_listener() {\n return ctx.btnResetGame();\n });\n i0.ɵɵtext(1);\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n i0.ɵɵadvance(1);\n i0.ɵɵtextInterpolate(ctx.name);\n }\n },\n styles: [\".game__menu-btn[_ngcontent-%COMP%]{width:100%;padding:12px 40px;margin-top:30px;font-weight:500;font-size:20px;text-align:center;color:#fff;background-color:var(--color-player1);border:none;border-radius:5px;cursor:pointer}\"]\n });\n return MenuBtnComponent;\n})();","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { innerFrom } from '../observable/innerFrom';\nimport { Observable } from '../Observable';\nimport { mergeMap } from '../operators/mergeMap';\nimport { isArrayLike } from '../util/isArrayLike';\nimport { isFunction } from '../util/isFunction';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nconst nodeEventEmitterMethods = ['addListener', 'removeListener'];\nconst eventTargetMethods = ['addEventListener', 'removeEventListener'];\nconst jqueryMethods = ['on', 'off'];\nexport function fromEvent(target, eventName, options, resultSelector) {\n if (isFunction(options)) {\n resultSelector = options;\n options = undefined;\n }\n\n if (resultSelector) {\n return fromEvent(target, eventName, options).pipe(mapOneOrManyArgs(resultSelector));\n }\n\n const [add, remove] = isEventTarget(target) ? eventTargetMethods.map(methodName => handler => target[methodName](eventName, handler, options)) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : [];\n\n if (!add) {\n if (isArrayLike(target)) {\n return mergeMap(subTarget => fromEvent(subTarget, eventName, options))(innerFrom(target));\n }\n }\n\n if (!add) {\n throw new TypeError('Invalid event target');\n }\n\n return new Observable(subscriber => {\n const handler = (...args) => subscriber.next(1 < args.length ? args : args[0]);\n\n add(handler);\n return () => remove(handler);\n });\n}\n\nfunction toCommonHandlerRegistry(target, eventName) {\n return methodName => handler => target[methodName](eventName, handler);\n}\n\nfunction isNodeStyleEventEmitter(target) {\n return isFunction(target.addListener) && isFunction(target.removeListener);\n}\n\nfunction isJQueryStyleEventEmitter(target) {\n return isFunction(target.on) && isFunction(target.off);\n}\n\nfunction isEventTarget(target) {\n return isFunction(target.addEventListener) && isFunction(target.removeEventListener);\n} //# sourceMappingURL=fromEvent.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"export function isValidDate(value) {\n return value instanceof Date && !isNaN(value);\n} //# sourceMappingURL=isDate.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { createErrorClass } from './createErrorClass';\nexport const UnsubscriptionError = createErrorClass(_super => function UnsubscriptionErrorImpl(errors) {\n _super(this);\n\n this.message = errors ? `${errors.length} errors occurred during unsubscription:\n${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\\n ')}` : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n}); //# sourceMappingURL=UnsubscriptionError.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { Subscription } from '../Subscription';\nimport { operate } from '../util/lift';\nimport { OperatorSubscriber } from './OperatorSubscriber';\nimport { arrRemove } from '../util/arrRemove';\nimport { asyncScheduler } from '../scheduler/async';\nimport { popScheduler } from '../util/args';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function bufferTime(bufferTimeSpan, ...otherArgs) {\n var _a, _b;\n\n const scheduler = (_a = popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : asyncScheduler;\n const bufferCreationInterval = (_b = otherArgs[0]) !== null && _b !== void 0 ? _b : null;\n const maxBufferSize = otherArgs[1] || Infinity;\n return operate((source, subscriber) => {\n let bufferRecords = [];\n let restartOnEmit = false;\n\n const emit = record => {\n const {\n buffer,\n subs\n } = record;\n subs.unsubscribe();\n arrRemove(bufferRecords, record);\n subscriber.next(buffer);\n restartOnEmit && startBuffer();\n };\n\n const startBuffer = () => {\n if (bufferRecords) {\n const subs = new Subscription();\n subscriber.add(subs);\n const buffer = [];\n const record = {\n buffer,\n subs\n };\n bufferRecords.push(record);\n executeSchedule(subs, scheduler, () => emit(record), bufferTimeSpan);\n }\n };\n\n if (bufferCreationInterval !== null && bufferCreationInterval >= 0) {\n executeSchedule(subscriber, scheduler, startBuffer, bufferCreationInterval, true);\n } else {\n restartOnEmit = true;\n }\n\n startBuffer();\n const bufferTimeSubscriber = new OperatorSubscriber(subscriber, value => {\n const recordsCopy = bufferRecords.slice();\n\n for (const record of recordsCopy) {\n const {\n buffer\n } = record;\n buffer.push(value);\n maxBufferSize <= buffer.length && emit(record);\n }\n }, () => {\n while (bufferRecords === null || bufferRecords === void 0 ? void 0 : bufferRecords.length) {\n subscriber.next(bufferRecords.shift().buffer);\n }\n\n bufferTimeSubscriber === null || bufferTimeSubscriber === void 0 ? void 0 : bufferTimeSubscriber.unsubscribe();\n subscriber.complete();\n subscriber.unsubscribe();\n }, undefined, () => bufferRecords = null);\n source.subscribe(bufferTimeSubscriber);\n });\n} //# sourceMappingURL=bufferTime.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { Observable } from '../Observable';\nimport { argsArgArrayOrObject } from '../util/argsArgArrayOrObject';\nimport { from } from './from';\nimport { identity } from '../util/identity';\nimport { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';\nimport { popResultSelector, popScheduler } from '../util/args';\nimport { createObject } from '../util/createObject';\nimport { OperatorSubscriber } from '../operators/OperatorSubscriber';\nimport { executeSchedule } from '../util/executeSchedule';\nexport function combineLatest(...args) {\n const scheduler = popScheduler(args);\n const resultSelector = popResultSelector(args);\n const {\n args: observables,\n keys\n } = argsArgArrayOrObject(args);\n\n if (observables.length === 0) {\n return from([], scheduler);\n }\n\n const result = new Observable(combineLatestInit(observables, scheduler, keys ? values => createObject(keys, values) : identity));\n return resultSelector ? result.pipe(mapOneOrManyArgs(resultSelector)) : result;\n}\nexport function combineLatestInit(observables, scheduler, valueTransform = identity) {\n return subscriber => {\n maybeSchedule(scheduler, () => {\n const {\n length\n } = observables;\n const values = new Array(length);\n let active = length;\n let remainingFirstValues = length;\n\n for (let i = 0; i < length; i++) {\n maybeSchedule(scheduler, () => {\n const source = from(observables[i], scheduler);\n let hasFirstValue = false;\n source.subscribe(new OperatorSubscriber(subscriber, value => {\n values[i] = value;\n\n if (!hasFirstValue) {\n hasFirstValue = true;\n remainingFirstValues--;\n }\n\n if (!remainingFirstValues) {\n subscriber.next(valueTransform(values.slice()));\n }\n }, () => {\n if (! --active) {\n subscriber.complete();\n }\n }));\n }, subscriber);\n }\n }, subscriber);\n };\n}\n\nfunction maybeSchedule(scheduler, execute, subscription) {\n if (scheduler) {\n executeSchedule(subscription, scheduler, execute);\n } else {\n execute();\n }\n} //# sourceMappingURL=combineLatest.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { isFunction } from './isFunction';\nexport function isScheduler(value) {\n return value && isFunction(value.schedule);\n} //# sourceMappingURL=isScheduler.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { operate } from '../util/lift';\nimport { OperatorSubscriber } from './OperatorSubscriber';\nexport function find(predicate, thisArg) {\n return operate(createFind(predicate, thisArg, 'value'));\n}\nexport function createFind(predicate, thisArg, emit) {\n const findIndex = emit === 'index';\n return (source, subscriber) => {\n let index = 0;\n source.subscribe(new OperatorSubscriber(subscriber, value => {\n const i = index++;\n\n if (predicate.call(thisArg, value, i, source)) {\n subscriber.next(findIndex ? i : value);\n subscriber.complete();\n }\n }, () => {\n subscriber.next(findIndex ? -1 : undefined);\n subscriber.complete();\n }));\n };\n} //# sourceMappingURL=find.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { Subject } from '../Subject';\nimport { Observable } from '../Observable';\nimport { defer } from './defer';\nconst DEFAULT_CONFIG = {\n connector: () => new Subject(),\n resetOnDisconnect: true\n};\nexport function connectable(source, config = DEFAULT_CONFIG) {\n let connection = null;\n const {\n connector,\n resetOnDisconnect = true\n } = config;\n let subject = connector();\n const result = new Observable(subscriber => {\n return subject.subscribe(subscriber);\n });\n\n result.connect = () => {\n if (!connection || connection.closed) {\n connection = defer(() => source).subscribe(subject);\n\n if (resetOnDisconnect) {\n connection.add(() => subject = connector());\n }\n }\n\n return connection;\n };\n\n return result;\n} //# sourceMappingURL=connectable.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { operate } from '../util/lift';\nimport { OperatorSubscriber } from './OperatorSubscriber';\nexport function every(predicate, thisArg) {\n return operate((source, subscriber) => {\n let index = 0;\n source.subscribe(new OperatorSubscriber(subscriber, value => {\n if (!predicate.call(thisArg, value, index++, source)) {\n subscriber.next(false);\n subscriber.complete();\n }\n }, () => {\n subscriber.next(true);\n subscriber.complete();\n }));\n });\n} //# sourceMappingURL=every.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nexport class Scheduler {\n constructor(schedulerActionCtor, now = Scheduler.now) {\n this.schedulerActionCtor = schedulerActionCtor;\n this.now = now;\n }\n\n schedule(work, delay = 0, state) {\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n }\n\n}\nScheduler.now = dateTimestampProvider.now; //# sourceMappingURL=Scheduler.js.map","map":null,"metadata":{},"sourceType":"module"}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ast":null,"code":"import { EmptyError } from '../util/EmptyError';\nimport { filter } from './filter';\nimport { take } from './take';\nimport { defaultIfEmpty } from './defaultIfEmpty';\nimport { throwIfEmpty } from './throwIfEmpty';\nimport { identity } from '../util/identity';\nexport function first(predicate, defaultValue) {\n const hasDefaultValue = arguments.length >= 2;\n return source => source.pipe(predicate ? filter((v, i) => predicate(v, i, source)) : identity, take(1), hasDefaultValue ? defaultIfEmpty(defaultValue) : throwIfEmpty(() => new EmptyError()));\n} //# sourceMappingURL=first.js.map","map":null,"metadata":{},"sourceType":"module"}
Loading