bottleneck
bottleneck copied to clipboard
Throw error for invalid settings
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
.