1.0.1 • Published 6 months ago

fetch-loop v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

fetch-loop

NPM version

Simple abstraction over fetch to only allow a certain amount of requests per interval of time.

API

FetchLoop provides a simple API over the browser fetch function that allows only a certain amount of requests per interval of time.

import { FetchLoop } from "fetch-loop";

const fl = new FetchLoop({
  intervalMilliseconds: 5_000,
  requestsPerInterval: 2,
});

for (let i = 10; i; i--) {
  fl.fetch(`https://jsonplaceholder.typicode.com/todos/${i}`)
    .then((response) => response.json())
    .then((json) => console.log(json));
}
0.1.0

7 months ago

1.0.1

6 months ago

1.0.0

6 months ago

0.1.1

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago

0.0.1

7 months ago

0.0.0

7 months ago