webdetector/.cache/25/c11b460ae007dc6957bc1817ab10ec.json

1 line
8.6 KiB
JSON
Raw Normal View History

2018-12-21 12:36:28 +00:00
{"id":"../node_modules/@pushrocks/smartrx/dist/smartrx.classes.observableintake.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/smartrx/ts/smartrx.classes.observableintake.ts","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/package.json","includedInParent":true,"mtime":1545395695572},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/smartrx/package.json","includedInParent":true,"mtime":1545395355372},{"name":"./smartrx.plugins","loc":{"line":3,"column":24},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/smartrx/dist/smartrx.classes.observableintake.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/smartrx/dist/smartrx.plugins.js"},{"name":"rxjs","loc":{"line":4,"column":23},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/smartrx/dist/smartrx.classes.observableintake.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/index.js"}],"generated":{"js":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst plugins = require(\"./smartrx.plugins\");\nconst rxjs_1 = require(\"rxjs\");\n/**\n * ObservableIntake\n */\nclass ObservableIntake {\n constructor() {\n this.observableFunctions = {\n next: payloadArg => {\n // nothing\n },\n complete: payloadArg => {\n // nothing\n }\n };\n this.generator = null;\n this.buffered = false;\n this.payloadBuffer = [];\n this.observable = rxjs_1.Observable.create(observerArg => {\n this.observableFunctions.next = (...args) => {\n return observerArg.next(...args);\n };\n this.observableFunctions.complete = (...args) => {\n this.completedDeffered.resolve();\n return observerArg.complete(...args);\n };\n });\n this.completedDeffered = plugins.smartpromise.defer();\n this.completed = this.completedDeffered.promise;\n }\n setObservable(observableFunc) {\n this.observable = observableFunc();\n }\n push(payloadArg) {\n if (this.buffered) {\n this.payloadBuffer.push(payloadArg);\n }\n else {\n this.internalPush(payloadArg);\n }\n }\n /**\n * pushes many payloads as array\n * @param payloadArgArray\n */\n pushMany(payloadArgArray) {\n for (let item of payloadArgArray) {\n this.push(item);\n }\n }\n /**\n * sets a generator to query the next pushed value\n * @param generatorArg\n */\n setGenerator(generatorArg) {\n this.generator = generatorArg;\n }\n makeBuffered() {\n this.buffered = true;\n }\n subscribe(...args) {\n return this.observable.subscribe(...args);\n }\n /**\n * request the next values in the quantity specified\n * @param howManyArg if a generator is set, of a buffer exists, this allows retrieving values\n */\n request(howManyArg) {\n if (howManyArg === 0) {\n return;\n }\n else {\n for (let i = 0; i !== howManyArg; i++) {\n if (this.payloadBuffer.length > 0) {\n this.internalPush(this.payloadBuffer.shift());\n }\n else {\n const nextPayload = this.generator();\n this.internalPush(nextPayload);\n }\n }\n }\n }\n /**\n * signals the completion of this observable\n */\n signalComplete() {\n this.observableFunctions.complete();\n }\n internalPush(payloadArg) {\n this.observableFunctions.next(payloadArg);\n }\n}\nexports.ObservableIntake = ObservableIntake;\n","map":{"version":3,"file":"smartrx.classes.observableintake.js","sourceRoot":"","sourc