1 line
11 KiB
JSON
1 line
11 KiB
JSON
{"id":"w9G6","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/defer.js.map","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/src/internal/observable/defer.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":"../Observable","loc":{"line":2,"column":27},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/defer.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/Observable.js"},{"name":"./from","loc":{"line":3,"column":21},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/defer.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/from.js"},{"name":"./empty","loc":{"line":4,"column":22},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/rxjs/_esm5/internal/observable/defer.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.defer=u;var e=require(\"../Observable\"),r=require(\"./from\"),t=require(\"./empty\");function u(u){return new e.Observable(function(e){var o;try{o=u()}catch(i){return void e.error(i)}return(o?(0,r.from)(o):(0,t.empty)()).subscribe(e)})}","map":{"mappings":[{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":0}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":13}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":20}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":35}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":43}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":56}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":57}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":64}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":68}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":76}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":82}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":3,"column":0},"generated":{"line":1,"column":84}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":3,"column":0},"generated":{"line":1,"column":88}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":3,"column":0},"generated":{"line":1,"column":90}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":3,"column":0},"generated":{"line":1,"column":98}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":4,"column":0},"generated":{"line":1,"column":115}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":4,"column":0},"generated":{"line":1,"column":117}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":4,"column":0},"generated":{"line":1,"column":125}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":53,"column":0},"generated":{"line":1,"column":135}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":53,"column":0},"generated":{"line":1,"column":137}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":53,"column":0},"generated":{"line":1,"column":145}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":54,"column":2},"generated":{"line":1,"column":156}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":54,"column":13},"generated":{"line":1,"column":165}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":54,"column":13},"generated":{"line":1,"column":167}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":170}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":177}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":8},"generated":{"line":1,"column":181}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":4},"generated":{"line":1,"column":183}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":47},"generated":{"line":1,"column":194}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":55,"column":47},"generated":{"line":1,"column":203}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":56,"column":8},"generated":{"line":1,"column":206}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":56,"column":8},"generated":{"line":1,"column":210}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":57,"column":6},"generated":{"line":1,"column":212}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":58,"column":5},"generated":{"line":1,"column":216}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":58,"column":5},"generated":{"line":1,"column":218}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":59,"column":6},"generated":{"line":1,"column":222}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":59,"column":6},"generated":{"line":1,"column":228}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":61,"column":5},"generated":{"line":1,"column":231}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":60,"column":6},"generated":{"line":1,"column":243}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":60,"column":13},"generated":{"line":1,"column":245}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":60,"column":23},"generated":{"line":1,"column":251}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":64,"column":5},"generated":{"line":1,"column":254}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":63,"column":17},"generated":{"line":1,"column":261}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":63,"column":18},"generated":{"line":1,"column":264}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":63,"column":28},"generated":{"line":1,"column":266}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":63,"column":28},"generated":{"line":1,"column":268}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":63,"column":28},"generated":{"line":1,"column":274}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":63,"column":39},"generated":{"line":1,"column":278}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":63,"column":4},"generated":{"line":1,"column":280}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":63,"column":4},"generated":{"line":1,"column":282}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":64,"column":5},"generated":{"line":1,"column":292}},{"source":"../../../src/internal/observable/defer.ts","name":null,"original":{"line":64,"column":5},"generated":{"line":1,"column":302}}],"sources":{"../../../src/internal/observable/defer.ts":"import { Observable } from '../Observable';\nimport { SubscribableOrPromise } from '../types';\nimport { from } from './from'; // lol\nimport { empty } from './empty';\n\n/**\n * Creates an Observable that, on subscribe, calls an Observable factory to\n * make an Observable for each new Observer.\n *\n * <span class=\"informal\">Creates the Observable lazily, that is, only when it\n * is subscribed.\n * </span>\n *\n * ![](defer.png)\n *\n * `defer` allows you to create the Observable only when the Observer\n * subscribes, and create a fresh Observable for each Observer. It waits until\n * an Observer subscribes to it, and then it generates an Observable,\n * typically with an Observable factory function. It does this afresh for each\n * subscriber, so although each subscriber may think it is subscribing to the\n * same Observable, in fact each subscriber gets its own individual\n * Observable.\n *\n * ## Example\n * ### Subscribe to either an Observable of clicks or an Observable of interval, at random\n * ```javascript\n * const clicksOrInterval = defer(function () {\n * return Math.random() > 0.5\n * ? fromEvent(document, 'click')\n * : interval(1000);\n * });\n * clicksOrInterval.subscribe(x => console.log(x));\n *\n * // Results in the following behavior:\n * // If the result of Math.random() is greater than 0.5 it will listen\n * // for clicks anywhere on the \"document\"; when document is clicked it\n * // will log a MouseEvent object to the console. If the result is less\n * // than 0.5 it will emit ascending numbers, one every second(1000ms).\n * ```\n *\n * @see {@link Observable}\n *\n * @param {function(): SubscribableOrPromise} observableFactory The Observable\n * factory function to invoke for each Observer that subscribes to the output\n * Observable. May also return a Promise, which will be converted on the fly\n * to an Observable.\n * @return {Observable} An Observable whose Observers' subscriptions trigger\n * an invocation of the given Observable factory function.\n * @static true\n * @name defer\n * @owner Observable\n */\nexport function defer<T>(observableFactory: () => SubscribableOrPromise<T> | void): Observable<T> {\n return new Observable(subscriber => {\n let input: SubscribableOrPromise<T> | void;\n try {\n input = observableFactory();\n } catch (err) {\n subscriber.error(err);\n return undefined;\n }\n const source = input ? from(input) : empty();\n return source.subscribe(subscriber);\n });\n}"},"lineCount":null}},"hash":"71ee17888d1f8a424825658efed1467b","cacheData":{"env":{}}} |