1 line
2.5 KiB
Plaintext
Executable File
1 line
2.5 KiB
Plaintext
Executable File
{"version":3,"file":"delay.js","sourceRoot":"","sources":["../../src/operator/delay.ts"],"names":[],"mappings":";AAAA,sBAAsB,oBAAoB,CAAC,CAAA;AAG3C,sBAAqC,oBAAoB,CAAC,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAA8C,KAAkB,EACvC,SAA6B;IAA7B,yBAA6B,GAA7B,yBAA6B;IACpD,MAAM,CAAC,aAAW,CAAI,KAAK,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC;AAChD,CAAC;AAHe,aAAK,QAGpB,CAAA","sourcesContent":["import { async } from '../scheduler/async';\nimport { IScheduler } from '../Scheduler';\nimport { Observable } from '../Observable';\nimport { delay as higherOrder } from '../operators/delay';\n\n/**\n * Delays the emission of items from the source Observable by a given timeout or\n * until a given Date.\n *\n * <span class=\"informal\">Time shifts each item by some specified amount of\n * milliseconds.</span>\n *\n * <img src=\"./img/delay.png\" width=\"100%\">\n *\n * If the delay argument is a Number, this operator time shifts the source\n * Observable by that amount of time expressed in milliseconds. The relative\n * time intervals between the values are preserved.\n *\n * If the delay argument is a Date, this operator time shifts the start of the\n * Observable execution until the given date occurs.\n *\n * @example <caption>Delay each click by one second</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var delayedClicks = clicks.delay(1000); // each click emitted after 1 second\n * delayedClicks.subscribe(x => console.log(x));\n *\n * @example <caption>Delay all clicks until a future date happens</caption>\n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var date = new Date('March 15, 2050 12:00:00'); // in the future\n * var delayedClicks = clicks.delay(date); // click emitted only after that date\n * delayedClicks.subscribe(x => console.log(x));\n *\n * @see {@link debounceTime}\n * @see {@link delayWhen}\n *\n * @param {number|Date} delay The delay duration in milliseconds (a `number`) or\n * a `Date` until which the emission of the source items is delayed.\n * @param {Scheduler} [scheduler=async] The IScheduler to use for\n * managing the timers that handle the time-shift for each item.\n * @return {Observable} An Observable that delays the emissions of the source\n * Observable by the specified timeout or Date.\n * @method delay\n * @owner Observable\n */\nexport function delay<T>(this: Observable<T>, delay: number|Date,\n scheduler: IScheduler = async): Observable<T> {\n return higherOrder<T>(delay, scheduler)(this);\n}\n"]} |