rxjs-poll 1.1.0 → 1.1.2
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 +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ request$
|
|
|
85
85
|
|
|
86
86
|
### Advance
|
|
87
87
|
|
|
88
|
-
Use delay function when you need unique delay or backoff strategies for polling/retrying.
|
|
88
|
+
Use delay function with provided [state](#PollState) when you need unique delay or backoff strategies for polling/retrying.
|
|
89
89
|
|
|
90
90
|
[Demo](https://stackblitz.com/edit/rxjs-awthuj?devtoolsheight=100&file=index.ts)
|
|
91
91
|
|
|
@@ -97,7 +97,7 @@ request$
|
|
|
97
97
|
.pipe(
|
|
98
98
|
poll({
|
|
99
99
|
retries: 6,
|
|
100
|
-
delay: ({
|
|
100
|
+
delay: ({ value, error, consecutiveRetries }) => {
|
|
101
101
|
const delay = 1000;
|
|
102
102
|
|
|
103
103
|
if (error) {
|
|
@@ -106,7 +106,7 @@ request$
|
|
|
106
106
|
return Math.pow(2, consecutiveRetries - 1) * delay;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
// Faster polls for
|
|
109
|
+
// Faster polls for shorter facts
|
|
110
110
|
return value.length < 100 ? delay * 0.3 : delay;
|
|
111
111
|
},
|
|
112
112
|
}),
|