Skip to content

Commit d304442

Browse files
committed
fix: standardize enum casing for IterableRetryBackoff and update documentation examples
1 parent c4bd009 commit d304442

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

example/src/hooks/useIterableApp.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export const IterableAppProvider: FunctionComponent<
152152
config.retryPolicy = {
153153
maxRetry: 5,
154154
retryInterval: 10,
155-
retryBackoff: IterableRetryBackoff.LINEAR,
155+
retryBackoff: IterableRetryBackoff.Linear,
156156
};
157157

158158
config.onJwtError = (authFailure) => {

src/core/classes/IterableConfig.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,16 @@ export class IterableConfig {
235235
/**
236236
* Configuration for JWT refresh retry behavior.
237237
* If not specified, the SDK will use default retry behavior.
238+
*
239+
* @example
240+
* ```typescript
241+
* const config = new IterableConfig();
242+
* config.retryPolicy = new IterableRetryPolicy({
243+
* maxRetries: 3,
244+
* initialDelay: 1000,
245+
* maxDelay: 10000,
246+
* });
247+
* ```
238248
*/
239249
retryPolicy?: IterableRetryPolicy;
240250

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
/* eslint-disable tsdoc/syntax */
2-
31
/**
42
* The type of backoff to use when retrying a request.
53
*/
64
export enum IterableRetryBackoff {
75
/**
86
* Linear backoff (each retry will wait for a fixed interval)
9-
* TODO: check with @Ayyanchira if this is correct
7+
*
8+
* EG: 2 seconds, 4 seconds, 6 seconds, 8 seconds, etc.
109
*/
11-
LINEAR = 'LINEAR',
10+
Linear = 'LINEAR',
1211
/**
1312
* Exponential backoff (each retry will wait for an interval that increases exponentially)
14-
* TODO: check with @Ayyanchira if this is correct
13+
*
14+
* EG: 2 seconds, 4 seconds, 8 seconds, 16 seconds, etc.
1515
*/
16-
EXPONENTIAL = 'EXPONENTIAL',
16+
Exponential = 'EXPONENTIAL',
1717
}

0 commit comments

Comments
 (0)