3 ms·
The expire() function should be made to work without a setTimeout. This makes it possible for the kvjs() instance to be garbage collected automatically when the
by realPubkey 3y ago
The expire() function should be made to work without a setTimeout. This makes it possible for the kvjs() instance to be garbage collected automatically when there is no more reference to it.
I recommend to use window.requestIdleCallback() directly after each read/write and the try to clean up old values, otherwise leave them there. That will also ensure that the cleanup never happens while the event loop is in a hot path.