{"id":"../node_modules/rxjs/_esm5/internal/observable/iif.js","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":1545395695572},{"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\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.iif = iif;\n\nvar _defer = require(\"./defer\");\n\nvar _empty = require(\"./empty\");\n\n/** PURE_IMPORTS_START _defer,_empty PURE_IMPORTS_END */\nfunction iif(condition, trueResult, falseResult) {\n if (trueResult === void 0) {\n trueResult = _empty.EMPTY;\n }\n\n if (falseResult === void 0) {\n falseResult = _empty.EMPTY;\n }\n\n return (0, _defer.defer)(function () {\n return condition() ? trueResult : falseResult;\n });\n}","map":{"mappings":[{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":3,"column":0},"generated":{"line":8,"column":0}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":92,"column":0},"generated":{"line":10,"column":0}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":2,"column":0},"generated":{"line":12,"column":0}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":13,"column":0}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":13,"column":9}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":13,"column":12}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":13,"column":13}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":13,"column":22}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":13,"column":24}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":13,"column":34}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":13,"column":36}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":2},"generated":{"line":13,"column":47}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":94,"column":46},"generated":{"line":13,"column":49}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":95,"column":2},"generated":{"line":14,"column":0}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":95,"column":2},"generated":{"line":14,"column":6}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":95,"column":2},"generated":{"line":14,"column":16}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":95,"column":2},"generated":{"line":14,"column":21}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":95,"column":2},"generated":{"line":14,"column":26}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":95,"column":2},"generated":{"line":14,"column":27}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":95,"column":2},"generated":{"line":14,"column":29}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":97,"column":2},"generated":{"line":15,"column":0}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":97,"column":2},"generated":{"line":15,"column":4}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":97,"column":20},"generated":{"line":15,"column":14}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":97,"column":20},"generated":{"line":15,"column":17}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":97,"column":2},"generated":{"line":15,"column":29}},{"source":"../../../src/internal/observable/iif.ts","name":null,"original":{"line":98,"column":1},"generated":{"line":16,"column":0}}],"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 * `If` statement for Observables.\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(\n condition: () => boolean,\n trueResult: SubscribableOrPromise = EMPTY,\n falseResult: SubscribableOrPromise = EMPTY\n): Observable {\n return defer(() => condition() ? trueResult : falseResult);\n}\n"},"lineCount":null}},"hash":"15fd28d3ea6249249364b11ea613fdbf","cacheData":{"env":{}}}