TooTallNate/node-weak

Can I 'save' an object from being GC'ed?

Closed this issue · 1 comments

Exactly what the title says.

If I store a new reference in the weak callback, can I save it?

If so, the object is the same or is it a copy? I mean, the callback will keep being called every time it is about to die, or I need to renew it?

Yes, I believe that you can save the object if you create a new reference to it. I believe that that "weak" instance is done at that point that, and you would need to create a new one. Please let me know if you run into any issues though!