-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: version 5.0.0 #1565
feat: version 5.0.0 #1565
Conversation
@Ganesha2552 this PR is heavily inspired by your approach with my own take on it. Please feel free to review it and see what you think. I believe this has a bit more freedom about it on defining multiple scales to work with |
@benjlevesque if I could request you look over this too, as I believe I merged your changes in correctly and handled them as necessary, but want a second set of eyes on it |
eea6967
to
00f4fea
Compare
ce555d7
to
d3749ac
Compare
can i qucikly mention that the skip option could also be named forRoot/ forRootAsync as people will be already familiar with the phraze of it |
@weshuiz I'm not sure I understand what you mean here. |
@jmcdo29 it was more of a name suggestion for the skip option |
@jmcdo29 looks all right for my part👍 This change seems super useful, congrats! |
@benjlevesque I've thought about it, but decided against it. Maintaining the backwards compatible |
d3749ac
to
f9468b1
Compare
This is a bit of something that I've wanted to do for a while and inspired by [this pr][pr]. With the new appraoch, we're now able to let users define scales at which they would like the throttling to work over, and let it work for any number of configuratins, from a single 10 requests in 5 seconds to scales of months, or milliseconds BREAKING CHANGES: It's worth noting there are quite a few breaking changes in this which will be reflected in the changelog as well, but better to have multiple mentions in my opinion * ttl is now in milliseconds, not seconds, but there are time helper exposed to ease the migration to that * the module options is now either an array or an object with a `throttlers` array property * `@Throttle()` now takes in an object instead of two parameters, to allow for setting multiple throttle contexts at once in a more readable manner * `@ThrottleSkip()` now takes in an object with string boolean to say which throttler should be skipped pr: #1522 ref: #1369 ref: #1522
This is a bit of something that I've wanted to do for a while and inspired by [this pr][pr]. With the new appraoch, we're now able to let users define scales at which they would like the throttling to work over, and let it work for any number of configuratins, from a single 10 requests in 5 seconds to scales of months, or milliseconds BREAKING CHANGES: It's worth noting there are quite a few breaking changes in this which will be reflected in the changelog as well, but better to have multiple mentions in my opinion * ttl is now in milliseconds, not seconds, but there are time helper exposed to ease the migration to that * the module options is now either an array or an object with a `throttlers` array property * `@Throttle()` now takes in an object instead of two parameters, to allow for setting multiple throttle contexts at once in a more readable manner * `@ThrottleSkip()` now takes in an object with string boolean to say which throttler should be skipped pr: #1522 ref: #1369 ref: #1522
3b8c3df
to
7dbcb5d
Compare
7dbcb5d
to
29e3164
Compare
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently we cannot have multiple throttler contexts
Issue Numbers:
ref: #1369
ref: #1522
ref: #1443
ref: #1388
ref: #1492
ref: #1089
ref: #1221
ref: #894
What is the new behavior?
This is a bit of something that I've wanted to do for a while and inspired by this pr. With the new approach, we're now able to let users define scales at which they would like the throttling to work over, and let it work for any number of configurations, from a single 10 requests in 5 seconds to scales of months, or milliseconds
Does this PR introduce a breaking change?
It's worth noting there are quite a few breaking changes in this which will be reflected in the changelog as well, but better to have multiple mentions in my opinion
throttlers
array property@Throttle()
now takes in an object instead of two parameters, to allow for setting multiple throttle contexts at once in a more readable manner@ThrottleSkip()
now takes in an object with string boolean to say which throttler should be skippedOther information
docs pr