Commit Graph

8 Commits

Author SHA1 Message Date
Bruno Windels
f34855573e replace ratelimitedfunc with lodash impl 2019-02-07 16:24:26 +00:00
David Baker
aab57d091d Make ratelimitedfunc time from the function's end
Otherwise any function tghat takes longer than the delay to execute
will become eligible for execution again immediately after
finishing and therefore be able to spin.

This should help with https://github.com/vector-im/riot-web/issues/6060
(at least in the respect that it makes ratelimitedfunc do its job)
even if it's not the reason Riot started getting wedged.
2018-02-06 14:39:13 +00:00
Luke Barnard
d3f9a3aeb5 Run eslint --fix
Fixing 1000s of lint issues. Some rules cannot be `--fix`ed but this goes some way to linting the entire codebase.
2017-10-11 17:56:17 +01:00
Richard van der Hoff
8fe470bce1 Cancel calls to rate-limited funcs on unmount
The tests were throwing up warnings about state being accessed, and null
MatrixClients being called, after component unmount.
2016-08-10 13:39:47 +01:00
David Baker
31399254b6 Fix onRoomStateMember debouncing
Don't have debounced functions take arsg, because they won't be the same for each invocation.
2016-07-26 18:15:26 +01:00
David Baker
4ecf5f6372 Fix bug where vector freezes on power level event
Make rate_limited_function accept functions with args so we can just ratelimit the event handler & be done with it.

Fixes https://github.com/vector-im/vector-web/issues/1877
2016-07-26 17:58:19 +01:00
David Baker
239abf4eca Style things from PR comments 2016-02-05 09:51:09 +00:00
David Baker
63776509a6 Make the function call-rate limiting a generic thing and use it in more places. 2016-02-04 18:06:24 +00:00