4.4.0 • Published 5 months ago

@osskit/fetch-enhancers v4.4.0

Weekly downloads
-
License
-
Repository
github
Last release
5 months ago

Bring your own FetchAPI implementation :pray:

Install

yarn add @osskit/fetch-enhancers

Usage

import { withTimeout, withRetry } from '@osskit/fetch-enhancers';

const fetchWithTimeout = withTimeout(fetch, {
  requestTimeoutMs: 5000,
}); // *optional* global options 5 seconds timeout

const fetchWithRetry = withRetry(fetch, {
  retries: 3,
  minTimeout: 1000, // In ms
  maxTimeout: 5000, // In ms
  factor: 5,
  randomize: false,
}); // *optional* global options object is async-retry's options object

// Compose enhancers:

const fetchWithRetryAndTimeout = withRetry(
  withTimeout(fetch, {
    requestTimeoutMs: 5000,
  }),
  {
    minTimeout: 1000, // In ms
    retries: 3,
    factor: 5,
  },
);
4.4.0

5 months ago

4.3.0

11 months ago

4.2.1

1 year ago

4.2.0

1 year ago

4.1.2

2 years ago

4.1.0

2 years ago

4.0.2

2 years ago

4.0.1

2 years ago

3.0.0

2 years ago

4.0.0

2 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

0.0.28

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.20

3 years ago

0.0.18

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago