webdetector/.cache/74/f978b0015e029c58d2db4779d429ad.json
2018-12-21 13:36:28 +01:00

1 line
10 KiB
JSON

{"id":"S+xp","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/iif.js.map","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/src/internal/observable/iif.ts","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/package.json","includedInParent":true,"mtime":1545395749058},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/package.json","includedInParent":true,"mtime":1545395355370},{"name":"./defer","loc":{"line":2,"column":22},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/iif.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/defer.js"},{"name":"./empty","loc":{"line":3,"column":22},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/iif.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/empty.js"}],"generated":{"js":"\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:!0}),exports.iif=t;var e=require(\"./defer\"),r=require(\"./empty\");function t(t,i,u){return void 0===i&&(i=r.EMPTY),void 0===u&&(u=r.EMPTY),(0,e.defer)(function(){return t()?i:u})}","map":{"mappings":[{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":0}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":13}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":20}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":35}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":43}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":56}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":57}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":64}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":68}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":76}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":80}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":3,"column":0},"generated":{"line":1,"column":82}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":3,"column":0},"generated":{"line":1,"column":86}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":3,"column":0},"generated":{"line":1,"column":88}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":3,"column":0},"generated":{"line":1,"column":96}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":92,"column":0},"generated":{"line":1,"column":107}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":92,"column":0},"generated":{"line":1,"column":109}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":92,"column":0},"generated":{"line":1,"column":117}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":1,"column":128}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":1,"column":137}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":1,"column":139}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":1,"column":141}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":1,"column":143}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":146}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":95,"column":2},"generated":{"line":1,"column":158}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":95,"column":2},"generated":{"line":1,"column":162}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":97,"column":2},"generated":{"line":1,"column":166}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":97,"column":20},"generated":{"line":1,"column":168}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":97,"column":2},"generated":{"line":1,"column":170}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":182}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":186}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":190}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":192}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":194}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":202}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":204}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":206}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":213}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":224}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":231}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":235}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":1,"column":237}}],"sources":{"../../../src/internal/observable/iif.ts":"import { Observable } from '../Observable';\nimport { defer } from './defer';\nimport { EMPTY } from './empty';\nimport { SubscribableOrPromise } from '../types';\n\n/**\n * Decides at subscription time which Observable will actually be subscribed.\n *\n * <span class=\"informal\">`If` statement for Observables.</span>\n *\n * `iif` accepts a condition function and two Observables. When\n * an Observable returned by the operator is subscribed, condition function will be called.\n * Based on what boolean it returns at that moment, consumer will subscribe either to\n * the first Observable (if condition was true) or to the second (if condition was false). Condition\n * function may also not return anything - in that case condition will be evaluated as false and\n * second Observable will be subscribed.\n *\n * Note that Observables for both cases (true and false) are optional. If condition points to an Observable that\n * was left undefined, resulting stream will simply complete immediately. That allows you to, rather\n * then controlling which Observable will be subscribed, decide at runtime if consumer should have access\n * to given Observable or not.\n *\n * If you have more complex logic that requires decision between more than two Observables, {@link defer}\n * will probably be a better choice. Actually `iif` can be easily implemented with {@link defer}\n * and exists only for convenience and readability reasons.\n *\n *\n * ## Examples\n * ### Change at runtime which Observable will be subscribed\n * ```javascript\n * let subscribeToFirst;\n * const firstOrSecond = iif(\n * () => subscribeToFirst,\n * of('first'),\n * of('second'),\n * );\n *\n * subscribeToFirst = true;\n * firstOrSecond.subscribe(value => console.log(value));\n *\n * // Logs:\n * // \"first\"\n *\n * subscribeToFirst = false;\n * firstOrSecond.subscribe(value => console.log(value));\n *\n * // Logs:\n * // \"second\"\n *\n * ```\n *\n * ### Control an access to an Observable\n * ```javascript\n * let accessGranted;\n * const observableIfYouHaveAccess = iif(\n * () => accessGranted,\n * of('It seems you have an access...'), // Note that only one Observable is passed to the operator.\n * );\n *\n * accessGranted = true;\n * observableIfYouHaveAccess.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('The end'),\n * );\n *\n * // Logs:\n * // \"It seems you have an access...\"\n * // \"The end\"\n *\n * accessGranted = false;\n * observableIfYouHaveAccess.subscribe(\n * value => console.log(value),\n * err => {},\n * () => console.log('The end'),\n * );\n *\n * // Logs:\n * // \"The end\"\n * ```\n *\n * @see {@link defer}\n *\n * @param {function(): boolean} condition Condition which Observable should be chosen.\n * @param {Observable} [trueObservable] An Observable that will be subscribed if condition is true.\n * @param {Observable} [falseObservable] An Observable that will be subscribed if condition is false.\n * @return {Observable} Either first or second Observable, depending on condition.\n * @static true\n * @name iif\n * @owner Observable\n */\nexport function iif<T, F>(\n condition: () => boolean,\n trueResult: SubscribableOrPromise<T> = EMPTY,\n falseResult: SubscribableOrPromise<F> = EMPTY\n): Observable<T|F> {\n return defer<T|F>(() => condition() ? trueResult : falseResult);\n}\n"},"lineCount":null}},"hash":"123e74cfe8d64522157eedc9d51f761c","cacheData":{"env":{}}}