bottleneck icon indicating copy to clipboard operation
bottleneck copied to clipboard

Throw error for invalid settings

Open vince1995 opened this issue 2 years ago • 0 comments

Hey, I was struggeling a lot because I thought there's something wrong in my code. But now I figured out, that I initialized the Bottleneck with "invalid" settings:

new Bottleneck({
    minTime: 50,
    reservoir: 50,
    reservoirRefreshInterval: 5000,
});

The Bottleneck refreshs every 5 seconds the resevoir, but I forgot to set reservoirRefreshAmount (because I thought that reservoir will be used for that). I think it would be good for other developers that if reservoirRefreshAmount is set it throws an error if reservoirRefreshAmount is not set (and vice versa). Same for reservoirIncreaseInterval and reservoirIncreaseAmount.

vince1995 avatar Apr 04 '22 12:04 vince1995