mcollina / bloomrun

A js pattern matcher
MIT License
120 stars 10 forks source link

add a destroy method #29

Closed davidmarkclements closed 8 years ago

davidmarkclements commented 8 years ago

it would be nice if we could do explicit cleanup

bloom.destroy() // remove all patterns and clean up any internal refs
mcollina commented 8 years ago

The question for having a bloom.destroy() is what is the state after doing so. Can you still add new patterns to it? If not, why don't you just do bloom = bloomrun()?

mcdonnelldean commented 8 years ago

@davidmarkclements comment on the above?

davidmarkclements commented 8 years ago

I forget my thought process around this - perhaps a bloom.clear() so you can add patterns again

mcdonnelldean commented 8 years ago

So bloomrun.clear() would be nice as long as it but I think it would ultimately be sugar over bloom = bloomrun(). Honestly though, I've yet to come across a time where it made sense to clear down patterns at runtime since the fault from that was usually a big issue.

mcdonnelldean commented 8 years ago

@mcollina Thoughts on this? I still haven't found a use case to be honest.

mcollina commented 8 years ago

So, I'm 👎 , I think we can close this for now. Feel free to reopen this at any time.