-
Add rate-limiting to
Callback
andAsyncCallback
:def rateLimit(window: Duration, maxPerWindow: Int = 1): {CallbackTo,AsyncCallback}[Option[A]]
def rateLimitMs(windowMs: Long, maxPerWindow: Int = 1): {CallbackTo,AsyncCallback}[Option[A]]
For example, if you wanted to limit a callback to a max of 5 times per second it would look like this:
callback.rateLimit(1.second, 5)
-
Add implicit
Reusability
instances for:SetIntervalHandle
SetTimeoutHandle
Callback.SetIntervalResult
Callback.SetTimeoutResult