{"version":3,"file":"ngxtension-poll.mjs","sources":["../../../../libs/ngxtension/poll/src/poll.ts","../../../../libs/ngxtension/poll/src/ngxtension-poll.ts"],"sourcesContent":["import { concatMap, MonoTypeOperatorFunction, Observable, timer } from 'rxjs';\n// source: https://netbasal.com/use-rxjs-to-modify-app-behavior-based-on-page-visibility-ce499c522be4\n\n/**\n * RxJS operator to apply to a stream that you want to poll every \"period\" milliseconds after an optional \"initialDelay\" milliseconds.\n *\n * @param period - Indicates the delay between 2 polls.\n * @param initialDelay - Indicates the delay before the first poll occurs.\n * @example This example shows how to do an HTTP GET every 5 seconds:\n * ```ts\n * http.get('http://api').pipe(poll(5000)).subscribe(result => {});\n * ```\n * @public\n */\nexport function poll<T>(\n\tperiod: number,\n\tinitialDelay = 0,\n): MonoTypeOperatorFunction<T> {\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n\treturn (source: Observable<T>) => {\n\t\treturn timer(initialDelay, period).pipe(concatMap(() => source));\n\t};\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AACA;AAEA;;;;;;;;;;AAUG;SACa,IAAI,CACnB,MAAc,EACd,YAAY,GAAG,CAAC,EAAA;;IAGhB,OAAO,CAAC,MAAqB,KAAI;AAChC,QAAA,OAAO,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC;AAClE,KAAC,CAAC;AACH;;ACtBA;;AAEG;;;;"}