I'm wondering if there are any possible risks or memory considerations to using a debounce (in our case, Lodash's implementation: https://github.com/lodash/lodash/blob/ddfd9b11a0126db2302cb70ec9973b66baec0975/lodash.js#L10304) with very large intervals, i.e. 24 hours. Specifically my use case is an event-based call to the backend to send a reminder email, and we don't want to spam customers with more than 1 reminder per day.
This question Building a promise chain recursively in javascript - memory considerations has a similar discussion, but about promises, and many at that (1000s or more). This would be a bit different as it is a single debounced function, and I believe the Lodash implementation of debounce
anyway properly handles and manages the setTimeout
and timeoutId
's properly, so maybe I'm over engineering / overthinking this and we should just ship it and see :)
To sum up, I understand this functionality should be delegated to some sort of backend queue at some point, but is it something we can "get away with" for now in the client?