rxjs-poll 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/cjs/common/observables.js +4 -6
- package/dist/cjs/common/observables.js.map +1 -1
- package/dist/cjs/poll.js +2 -2
- package/dist/cjs/poll.js.map +1 -1
- package/dist/esm/common/observables.js +4 -6
- package/dist/esm/common/observables.js.map +1 -1
- package/dist/esm/poll.js +2 -2
- package/dist/esm/poll.js.map +1 -1
- package/dist/types/common/observables.d.ts.map +1 -1
- package/dist/types/types/config.type.d.ts +94 -14
- package/dist/types/types/config.type.d.ts.map +1 -1
- package/dist/types/types/poll.type.d.ts +31 -1
- package/dist/types/types/poll.type.d.ts.map +1 -1
- package/dist/types/types/strategies.type.d.ts +14 -0
- package/dist/types/types/strategies.type.d.ts.map +1 -1
- package/dist/types/types/utils.type.d.ts +8 -0
- package/dist/types/types/utils.type.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -136,7 +136,7 @@ interface PollConfig {
|
|
|
136
136
|
*/
|
|
137
137
|
delay?: {
|
|
138
138
|
/**
|
|
139
|
-
* Strategy
|
|
139
|
+
* Strategy type for delay timing. Built-in strategies (except dynamic)
|
|
140
140
|
* calculate time per state's `pollCount`.
|
|
141
141
|
* @default 'constant'
|
|
142
142
|
*/
|
|
@@ -160,13 +160,13 @@ interface PollConfig {
|
|
|
160
160
|
*/
|
|
161
161
|
retry?: {
|
|
162
162
|
/**
|
|
163
|
-
* Strategy
|
|
163
|
+
* Strategy type for retry timing. Built-in strategies (except dynamic)
|
|
164
164
|
* calculate time per state:
|
|
165
165
|
* - consecutiveOnly: true → uses `consecutiveRetryCount`
|
|
166
166
|
* - consecutiveOnly: false → uses `retryCount`
|
|
167
167
|
* @default 'exponential'
|
|
168
168
|
*/
|
|
169
|
-
|
|
169
|
+
strategy: 'constant' | 'linear' | 'exponential' | 'random' | 'dynamic';
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
172
|
* Time (ms) depending on strategy:
|
|
@@ -216,6 +216,13 @@ State object passed to delay/retry time producer functions:
|
|
|
216
216
|
|
|
217
217
|
```typescript
|
|
218
218
|
interface PollState<T> {
|
|
219
|
+
/** Latest value from the source. For `interval` polling mode,
|
|
220
|
+
* first emission is undefined. */
|
|
221
|
+
value: T | undefined;
|
|
222
|
+
|
|
223
|
+
/** Latest error when retrying */
|
|
224
|
+
error: any | undefined;
|
|
225
|
+
|
|
219
226
|
/** Total number of successful poll operations */
|
|
220
227
|
pollCount: number;
|
|
221
228
|
|
|
@@ -224,13 +231,6 @@ interface PollState<T> {
|
|
|
224
231
|
|
|
225
232
|
/** Current number of consecutive retry attempts */
|
|
226
233
|
consecutiveRetryCount: number;
|
|
227
|
-
|
|
228
|
-
/** Latest value from the source. For `interval` polling mode,
|
|
229
|
-
* first emission is undefined. */
|
|
230
|
-
value: T | undefined;
|
|
231
|
-
|
|
232
|
-
/** Latest error when retrying */
|
|
233
|
-
error: any | undefined;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
/** Note: pollCount + retryCount = total attempts */
|
|
@@ -11,16 +11,14 @@ function getPoller$(type, source$, getTime) {
|
|
|
11
11
|
lastValue = value;
|
|
12
12
|
}));
|
|
13
13
|
return type === 'repeat'
|
|
14
|
-
? completed
|
|
15
|
-
|
|
16
|
-
}))
|
|
17
|
-
: dynamicInterval$(function () { return getTime(lastValue); }).pipe((0, rxjs_1.switchMap)(function () { return completed$; }));
|
|
14
|
+
? repeatWith$(completed$, function () { return getTime(lastValue); })
|
|
15
|
+
: repeatWith$((0, rxjs_1.of)(null), function () { return getTime(lastValue); }).pipe((0, rxjs_1.switchMap)(function () { return completed$; }));
|
|
18
16
|
}
|
|
19
17
|
function pageVisibility$() {
|
|
20
18
|
return (0, utils_1.isBrowser)() ? (0, rxjs_1.fromEvent)(document, 'visibilitychange').pipe((0, rxjs_1.startWith)(null), (0, rxjs_1.map)(utils_1.isDocumentVisible)) : (0, rxjs_1.of)(true);
|
|
21
19
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
20
|
+
function repeatWith$(source$, getTime) {
|
|
21
|
+
return source$.pipe((0, rxjs_1.repeat)({
|
|
24
22
|
delay: function () { return (0, rxjs_1.timer)(getTime()); },
|
|
25
23
|
}));
|
|
26
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observables.js","sourceRoot":"","sources":["../../../src/common/observables.ts"],"names":[],"mappings":";;;AAOA,
|
|
1
|
+
{"version":3,"file":"observables.js","sourceRoot":"","sources":["../../../src/common/observables.ts"],"names":[],"mappings":";;;AAOA,gCAYC;AAnBD,6BAAuH;AAGvH,iCAAuD;AAE1C,QAAA,gBAAgB,GAAG,eAAe,EAAE,CAAC,IAAI,CAAC,IAAA,kBAAW,EAAC,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAEvG,SAAgB,UAAU,CAAI,IAAc,EAAE,OAAsB,EAAE,OAA6B;IACjG,IAAI,SAAY,CAAC;IACjB,IAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAC7B,IAAA,eAAQ,EAAC,CAAC,CAAC,EACX,IAAA,UAAG,EAAC,UAAC,KAAK;QACR,SAAS,GAAG,KAAK,CAAC;IACpB,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,IAAI,KAAK,QAAQ;QACtB,CAAC,CAAC,WAAW,CAAC,UAAU,EAAE,cAAM,OAAA,OAAO,CAAC,SAAS,CAAC,EAAlB,CAAkB,CAAC;QACnD,CAAC,CAAC,WAAW,CAAC,IAAA,SAAE,EAAC,IAAI,CAAC,EAAE,cAAM,OAAA,OAAO,CAAC,SAAS,CAAC,EAAlB,CAAkB,CAAC,CAAC,IAAI,CAAC,IAAA,gBAAS,EAAC,cAAM,OAAA,UAAU,EAAV,CAAU,CAAC,CAAC,CAAC;AACxF,CAAC;AAED,SAAS,eAAe;IACtB,OAAO,IAAA,iBAAS,GAAE,CAAC,CAAC,CAAC,IAAA,gBAAS,EAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAA,gBAAS,EAAC,IAAI,CAAC,EAAE,IAAA,UAAG,EAAC,yBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,SAAE,EAAC,IAAI,CAAC,CAAC;AACxH,CAAC;AAED,SAAS,WAAW,CAAI,OAAsB,EAAE,OAAqB;IACnE,OAAO,OAAO,CAAC,IAAI,CACjB,IAAA,aAAM,EAAC;QACL,KAAK,EAAE,cAAM,OAAA,IAAA,YAAK,EAAC,OAAO,EAAE,CAAC,EAAhB,CAAgB;KAC9B,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/cjs/poll.js
CHANGED
|
@@ -10,11 +10,11 @@ function poll(config) {
|
|
|
10
10
|
var _a = (0, config_1.extendConfig)(config), type = _a.type, retry = _a.retry, pauseWhenHidden = _a.pauseWhenHidden, getDelayTime = _a.getDelayTime, getRetryTime = _a.getRetryTime;
|
|
11
11
|
var retryKey = retry.consecutiveOnly ? 'consecutiveRetryCount' : 'retryCount';
|
|
12
12
|
var state = {
|
|
13
|
+
value: undefined,
|
|
14
|
+
error: undefined,
|
|
13
15
|
pollCount: 0,
|
|
14
16
|
retryCount: 0,
|
|
15
17
|
consecutiveRetryCount: 0,
|
|
16
|
-
value: undefined,
|
|
17
|
-
error: undefined,
|
|
18
18
|
};
|
|
19
19
|
var nextDelayTime = function (value) {
|
|
20
20
|
state.pollCount += 1;
|
package/dist/cjs/poll.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poll.js","sourceRoot":"","sources":["../../src/poll.ts"],"names":[],"mappings":";;AAoCA,oBA4CC;AAhFD,6BAAsE;AAEtE,0CAA+C;AAC/C,oDAAoE;AACpE,gDAA+C;AAgC/C,SAAgB,IAAI,CAAI,MAA4B;IAClD,OAAO,UAAC,OAAO;QACP,IAAA,KAA+D,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UAAU,GAAG;YACjB,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;YACxB,KAAK,CAAC,qBAAqB,GAAG,CAAC,CAAC;QAClC,CAAC,CAAC;QAEF,IAAM,YAAY,GAAG;YACnB,KAAK,CAAC,UAAU,IAAI,CAAC,CAAC;YACtB,KAAK,CAAC,qBAAqB,IAAI,CAAC,CAAC;YAEjC,OAAO,KAAK,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;QACvC,CAAC,CAAC;QAEF,IAAM,WAAW,GAAG,eAAe,CAAC,CAAC,CAAC,8BAAgB,CAAC,CAAC,CAAC,IAAA,SAAE,EAAC,IAAI,CAAC,CAAC;QAClE,IAAM,OAAO,GAAG,IAAA,wBAAU,EAAC,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;QAEzD,OAAO,WAAW,CAAC,IAAI,CACrB,IAAA,gBAAS,EAAC,UAAC,SAAS,IAAK,OAAA,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,qBAAS,EAAC,YAAY,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,YAAK,CAAC,EAAtF,CAAsF,CAAC,CACjH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -7,16 +7,14 @@ export function getPoller$(type, source$, getTime) {
|
|
|
7
7
|
lastValue = value;
|
|
8
8
|
}));
|
|
9
9
|
return type === 'repeat'
|
|
10
|
-
? completed
|
|
11
|
-
|
|
12
|
-
}))
|
|
13
|
-
: dynamicInterval$(() => getTime(lastValue)).pipe(switchMap(() => completed$));
|
|
10
|
+
? repeatWith$(completed$, () => getTime(lastValue))
|
|
11
|
+
: repeatWith$(of(null), () => getTime(lastValue)).pipe(switchMap(() => completed$));
|
|
14
12
|
}
|
|
15
13
|
function pageVisibility$() {
|
|
16
14
|
return isBrowser() ? fromEvent(document, 'visibilitychange').pipe(startWith(null), map(isDocumentVisible)) : of(true);
|
|
17
15
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
16
|
+
function repeatWith$(source$, getTime) {
|
|
17
|
+
return source$.pipe(repeat({
|
|
20
18
|
delay: () => timer(getTime()),
|
|
21
19
|
}));
|
|
22
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observables.js","sourceRoot":"","sources":["../../../src/common/observables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAc,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAGvH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAEvG,MAAM,UAAU,UAAU,CAAI,IAAc,EAAE,OAAsB,EAAE,OAA6B;IACjG,IAAI,SAAY,CAAC;IACjB,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAC7B,QAAQ,CAAC,CAAC,CAAC,EACX,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACZ,SAAS,GAAG,KAAK,CAAC;IACpB,CAAC,CAAC,CACH,CAAC;IAEF,OAAO,IAAI,KAAK,QAAQ;QACtB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"observables.js","sourceRoot":"","sources":["../../../src/common/observables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAc,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAGvH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAA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(config) {
|
|
|
7
7
|
const { type, retry, pauseWhenHidden, getDelayTime, getRetryTime } = extendConfig(config);
|
|
8
8
|
const retryKey = retry.consecutiveOnly ? 'consecutiveRetryCount' : 'retryCount';
|
|
9
9
|
const state = {
|
|
10
|
+
value: undefined,
|
|
11
|
+
error: undefined,
|
|
10
12
|
pollCount: 0,
|
|
11
13
|
retryCount: 0,
|
|
12
14
|
consecutiveRetryCount: 0,
|
|
13
|
-
value: undefined,
|
|
14
|
-
error: undefined,
|
|
15
15
|
};
|
|
16
16
|
const nextDelayTime = (value) => {
|
|
17
17
|
state.pollCount += 1;
|
package/dist/esm/poll.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poll.js","sourceRoot":"","sources":["../../src/poll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA4B,EAAE,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAgC/C,MAAM,UAAU,IAAI,CAAI,MAA4B;IAClD,OAAO,CAAC,OAAO,EAAE,EAAE;QACjB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QAC1F,MAAM,QAAQ,GAAa,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;QAC1F,MAAM,KAAK,GAAiB;YAC1B,
|
|
1
|
+
{"version":3,"file":"poll.js","sourceRoot":"","sources":["../../src/poll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA4B,EAAE,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEtE,OAAO,EAAE,YAA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CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;QACvC,CAAC,CAAC;QAEF,MAAM,WAAW,GAAG,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;QAClE,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC;QAEzD,OAAO,WAAW,CAAC,IAAI,CACrB,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CACjH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observables.d.ts","sourceRoot":"","sources":["../../../src/common/observables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAuE,MAAM,MAAM,CAAC;AAEvH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,eAAO,MAAM,gBAAgB,qBAAyE,CAAC;AAEvG,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"observables.d.ts","sourceRoot":"","sources":["../../../src/common/observables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,UAAU,EAAuE,MAAM,MAAM,CAAC;AAEvH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,eAAO,MAAM,gBAAgB,qBAAyE,CAAC;AAEvG,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAYlH"}
|
|
@@ -1,22 +1,51 @@
|
|
|
1
1
|
import { PollTimeProducer, PollType } from './poll.type';
|
|
2
2
|
import { DynamicFunction, StrategyType } from './strategies.type';
|
|
3
3
|
import { MinMax, Nil } from './utils.type';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration object for the poll operator
|
|
6
|
+
* @template T - Type of the observable value being polled
|
|
7
|
+
*/
|
|
4
8
|
export type PollConfig<T> = {
|
|
9
|
+
/**
|
|
10
|
+
* Defines the polling behavior:
|
|
11
|
+
* - "repeat": Polls after current source completes
|
|
12
|
+
* - "interval": Polls in intervals, dropping any ongoing source operations
|
|
13
|
+
* @default "repeat"
|
|
14
|
+
*/
|
|
5
15
|
type?: PollType | Nil;
|
|
16
|
+
/**
|
|
17
|
+
* Configuration for polling delays (between successful operations)
|
|
18
|
+
*/
|
|
6
19
|
delay?: PollDelayConfig<T> | Nil;
|
|
20
|
+
/**
|
|
21
|
+
* Configuration for retry behavior (on errors)
|
|
22
|
+
*/
|
|
7
23
|
retry?: PollRetryConfig<T> | Nil;
|
|
24
|
+
/**
|
|
25
|
+
* [Browser only] Controls polling behavior when page isn't visible
|
|
26
|
+
* - "true": Pause polling when tab isn't active, and resume on active
|
|
27
|
+
* - "false": Poll even when tab isn't focused
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
8
30
|
pauseWhenHidden?: boolean | Nil;
|
|
9
31
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Type-safe delay configuration with strategy-specific time constraints.
|
|
34
|
+
* Ensures that the `time` property type matches the selected strategy:
|
|
35
|
+
*
|
|
36
|
+
* **Strategy:**
|
|
37
|
+
* - "constant": Fixed timing
|
|
38
|
+
* - "random": Random timing within a range
|
|
39
|
+
* - "dynamic": Custom function-based timing
|
|
40
|
+
*
|
|
41
|
+
* **Time:**
|
|
42
|
+
* - "constant": number
|
|
43
|
+
* - "random": [min, max]
|
|
44
|
+
* - "dynamic": (state) => number | [min, max]
|
|
45
|
+
*
|
|
46
|
+
* @template T - Type of the observable value being polled
|
|
47
|
+
* @default { strategy: "constant", time: 1000 }
|
|
48
|
+
*/
|
|
20
49
|
export type PollDelayConfig<T> = {
|
|
21
50
|
time: DynamicFunction<T>;
|
|
22
51
|
strategy: Extract<StrategyType, 'dynamic'>;
|
|
@@ -27,10 +56,31 @@ export type PollDelayConfig<T> = {
|
|
|
27
56
|
time: number;
|
|
28
57
|
strategy: Extract<StrategyType, 'constant'>;
|
|
29
58
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Type-safe retry configuration with strategy-specific time constraints and optional settings.
|
|
61
|
+
* Allows either full configuration with strategy/time or minimal configuration with just limit/consecutiveOnly.
|
|
62
|
+
*
|
|
63
|
+
* **Strategy:**
|
|
64
|
+
* - "constant": Fixed timing
|
|
65
|
+
* - "linear": Linearly increasing timing
|
|
66
|
+
* - "exponential": Exponentially increasing timing
|
|
67
|
+
* - "random": Random timing within a range
|
|
68
|
+
* - "dynamic": Custom function-based timing
|
|
69
|
+
*
|
|
70
|
+
* **Time:**
|
|
71
|
+
* - "constant": number
|
|
72
|
+
* - "linear": number
|
|
73
|
+
* - "exponential": number
|
|
74
|
+
* - "random": [min, max]
|
|
75
|
+
* - "dynamic": (state) => number | [min, max]
|
|
76
|
+
*
|
|
77
|
+
* **Options:**
|
|
78
|
+
* - "limit": Maximum retry attempts before throwing error
|
|
79
|
+
* - "consecutiveOnly": Whether to count only consecutive retries or all retries
|
|
80
|
+
*
|
|
81
|
+
* @template T - Type of the observable value being polled
|
|
82
|
+
* @default { strategy: "exponential", time: 1000, limit: 3, consecutiveOnly: true }
|
|
83
|
+
*/
|
|
34
84
|
export type PollRetryConfig<T> = (({
|
|
35
85
|
time: DynamicFunction<T>;
|
|
36
86
|
strategy: Extract<StrategyType, 'dynamic'>;
|
|
@@ -49,6 +99,36 @@ export type PollRetryConfig<T> = (({
|
|
|
49
99
|
strategy?: never;
|
|
50
100
|
time?: never;
|
|
51
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* Extended configuration that includes computed time producer functions
|
|
104
|
+
* @template T - Type of the observable value being polled
|
|
105
|
+
*/
|
|
106
|
+
export type ExtendedPollConfig<T> = NormalizedPollConfig<T> & {
|
|
107
|
+
getDelayTime: PollTimeProducer<T>;
|
|
108
|
+
getRetryTime: PollTimeProducer<T>;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Normalized configuration with all optional fields resolved to their default values
|
|
112
|
+
* @template T - Type of the observable value being polled
|
|
113
|
+
*/
|
|
114
|
+
export type NormalizedPollConfig<T> = {
|
|
115
|
+
type: PollType;
|
|
116
|
+
delay: NormalizedPollDelayConfig<T>;
|
|
117
|
+
retry: NormalizedPollRetryConfig<T>;
|
|
118
|
+
pauseWhenHidden: boolean;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Normalized delay configuration with resolved defaults
|
|
122
|
+
* @template T - Type of the observable value being polled
|
|
123
|
+
*/
|
|
124
|
+
export type NormalizedPollDelayConfig<T> = {
|
|
125
|
+
time: number | MinMax | DynamicFunction<T>;
|
|
126
|
+
strategy: StrategyType;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Normalized retry configuration with resolved defaults
|
|
130
|
+
* @template T - Type of the observable value being polled
|
|
131
|
+
*/
|
|
52
132
|
export type NormalizedPollRetryConfig<T> = {
|
|
53
133
|
time: number | MinMax | DynamicFunction<T>;
|
|
54
134
|
strategy: StrategyType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.type.d.ts","sourceRoot":"","sources":["../../../src/types/config.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAC1B,IAAI,CAAC,EAAE,QAAQ,GAAG,GAAG,CAAC;IACtB,KAAK,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACjC,KAAK,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACjC,eAAe,CAAC,EAAE,OAAO,GAAG,GAAG,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"config.type.d.ts","sourceRoot":"","sources":["../../../src/types/config.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAC1B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,GAAG,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACjC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,GAAG,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,eAAe,CAAC,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,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI;IACpC,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;IACpC,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;IACpC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI;IACzC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IAC3C,QAAQ,EAAE,YAAY,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI;IACzC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IAC3C,QAAQ,EAAE,YAAY,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC"}
|
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
import { pollMode, pollType } from '../constants/poll.const';
|
|
2
|
+
/**
|
|
3
|
+
* Defines the polling behavior mode
|
|
4
|
+
* - "delay": Delay mode
|
|
5
|
+
* - "retry": Retry mode
|
|
6
|
+
*/
|
|
2
7
|
export type PollMode = (typeof pollMode)[keyof typeof pollMode];
|
|
8
|
+
/**
|
|
9
|
+
* Defines the polling behavior type
|
|
10
|
+
* - "repeat": Polls after current source completes
|
|
11
|
+
* - "interval": Polls in intervals, dropping any ongoing source operations
|
|
12
|
+
*/
|
|
3
13
|
export type PollType = (typeof pollType)[keyof typeof pollType];
|
|
14
|
+
/**
|
|
15
|
+
* Current polling state information available to timing functions
|
|
16
|
+
*/
|
|
4
17
|
export type PollState<T> = {
|
|
5
|
-
|
|
18
|
+
/** Latest value from the source. For "interval" polling mode, first emission is undefined. */
|
|
6
19
|
value: T | undefined;
|
|
20
|
+
/** Latest error when retrying */
|
|
7
21
|
error: any | undefined;
|
|
22
|
+
/** Total number of successful poll operations */
|
|
23
|
+
pollCount: number;
|
|
8
24
|
} & Record<RetryKey, number>;
|
|
25
|
+
/**
|
|
26
|
+
* Keys for retry counting in PollState
|
|
27
|
+
* - "retryCount": Total number of retry attempts
|
|
28
|
+
* - "consecutiveRetryCount": Current number of consecutive retry attempts
|
|
29
|
+
*/
|
|
9
30
|
export type RetryKey = 'retryCount' | 'consecutiveRetryCount';
|
|
31
|
+
/**
|
|
32
|
+
* All possible keys in the PollState object
|
|
33
|
+
*/
|
|
10
34
|
export type PollStateKeys = keyof PollState<unknown>;
|
|
35
|
+
/**
|
|
36
|
+
* Function that produces time values based on poll state
|
|
37
|
+
* Used for dynamic timing strategies in delay and retry configurations
|
|
38
|
+
* @param state - Current poll state containing counts, value, and error information
|
|
39
|
+
* @returns Time in milliseconds for the next delay/retry
|
|
40
|
+
*/
|
|
11
41
|
export type PollTimeProducer<T> = (state: PollState<T>) => number;
|
|
12
42
|
//# sourceMappingURL=poll.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poll.type.d.ts","sourceRoot":"","sources":["../../../src/types/poll.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IACzB,
|
|
1
|
+
{"version":3,"file":"poll.type.d.ts","sourceRoot":"","sources":["../../../src/types/poll.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI;IACzB,8FAA8F;IAC9F,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC;IACrB,iCAAiC;IACjC,KAAK,EAAE,GAAG,GAAG,SAAS,CAAC;IACvB,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;CAMnB,GAAG,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAE7B;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,uBAAuB,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC;AAErD;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC"}
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { strategyType } from '../constants/strategies.const';
|
|
2
2
|
import { PollState } from './poll.type';
|
|
3
3
|
import { MinMax } from './utils.type';
|
|
4
|
+
/**
|
|
5
|
+
* Available timing strategy types for delay and retry configurations
|
|
6
|
+
* - "constant": Fixed time value
|
|
7
|
+
* - "linear": Linearly increasing time based on attempt count
|
|
8
|
+
* - "exponential": Exponentially increasing time based on attempt count
|
|
9
|
+
* - "random": Random time within specified range
|
|
10
|
+
* - "dynamic": Custom function that returns time based on poll state
|
|
11
|
+
*/
|
|
4
12
|
export type StrategyType = (typeof strategyType)[keyof typeof strategyType];
|
|
13
|
+
/**
|
|
14
|
+
* Function for dynamic timing strategies that calculates delay/retry time
|
|
15
|
+
* based on current poll state
|
|
16
|
+
* @param state - Current poll state containing counts, latest value, and error
|
|
17
|
+
* @returns Either a fixed time in milliseconds or a [min, max] range for random selection
|
|
18
|
+
*/
|
|
5
19
|
export type DynamicFunction<T> = (state: PollState<T>) => number | MinMax;
|
|
6
20
|
//# sourceMappingURL=strategies.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strategies.type.d.ts","sourceRoot":"","sources":["../../../src/types/strategies.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE5E,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"strategies.type.d.ts","sourceRoot":"","sources":["../../../src/types/strategies.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents null or undefined values
|
|
3
|
+
*/
|
|
1
4
|
export type Nil = null | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Tuple representing a minimum and maximum value range
|
|
7
|
+
* Used for random timing strategies where time is selected randomly between min and max
|
|
8
|
+
* @example [1000, 5000] // Random time between 1 and 5 seconds
|
|
9
|
+
*/
|
|
2
10
|
export type MinMax = [min: number, max: number];
|
|
3
11
|
//# sourceMappingURL=utils.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.type.d.ts","sourceRoot":"","sources":["../../../src/types/utils.type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,GAAG,IAAI,GAAG,SAAS,CAAC;AAEnC,MAAM,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.type.d.ts","sourceRoot":"","sources":["../../../src/types/utils.type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,IAAI,GAAG,SAAS,CAAC;AAEnC;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rxjs-poll",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "RxJS operator for polling",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rxjs",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@types/node": "^24.0.1",
|
|
77
77
|
"@typescript-eslint/eslint-plugin": "^8.34.0",
|
|
78
78
|
"@typescript-eslint/parser": "^8.34.0",
|
|
79
|
-
"cross-env": "^
|
|
79
|
+
"cross-env": "^10.0.0",
|
|
80
80
|
"eslint": "^9.29.0",
|
|
81
81
|
"eslint-config-prettier": "^10.1.5",
|
|
82
82
|
"eslint-config-xo": "^0.47.0",
|