Provide configurable Reflex object cleanup hook #609
Labels
enhancement
New feature or request
experimental
javascript
Pull requests that update Javascript code
proposal
Milestone
Just moving this out of #592, and stashing it as a TODO issue.
As @hopsoft said in this comment:
To which I replied:
There's two high-level approaches possible:
setInterval
that runs globally, purges everyn
seconds (configurable viainitialize
option)Both approaches would execute a callback (with a default provided), with overrides passed as an option to
StimulusReflex.initialize()
.Which path do you prefer?
As for the default callback, there's lots of ways to slice it:
setTimeout(n)
seconds after they are finalizedn
size configurableThe cool thing is that we really could make the default
() => {}
and then give examples of all of the others in the docs, with an explanation about why they might want to clean up. In some ways, I like defaulting to a null function because of the principle of least surprise.The text was updated successfully, but these errors were encountered: