@curiouser/rxjs-rate-limit

0.1.0 • Public • Published

RxJS Rate Limiter (mostly lossless)

  • RxJS 7 pipeline operator
  • Dead simple (40 lines)
  • No dependencies
  • Processes immediately, no delay to emissions

Beware

  • No retries, that's up to you
  • Currently only packaged for CommonJS. Open an issue if you'd like to consume an ESM.

Installation

npm add @curiouser/rxjs-rate-limit

Usage

const rateLimit = require('@curiouser/rxjs-rate-limit');

// 20 per second
someObservable.pipe(
  rateLimit(20, 1000),
  // do something that should be rate limited
);

Examples

See examples directory for examples you can run from CLI.

Package Sidebar

Install

npm i @curiouser/rxjs-rate-limit

Weekly Downloads

5

Version

0.1.0

License

ISC

Unpacked Size

3 kB

Total Files

4

Last publish

Collaborators

  • winstonhoy