1.0.1 • Published 6 years ago

rxjs-ratelimit-operator v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

An operator for RxJS 6+ that applies rate limiting as seen on many HTTP APIs.

rateLimit()

Given a limit and a window, only emit limit items within a rolling window duration. Extra items are delayed until the window is no longer full.

rateLimit marble diagram

Example

import { rateLimit } from "rxjs-ratelimit-operator";

// Send no more than 120 requests per minute
request$.pipe(rateLimit(120, 60000)).subscribe(sendRequest);
1.0.1

6 years ago

1.0.0

6 years ago