Consider using Explicit Resource Management
in ECMAScript once available
#794
Labels
Milestone
Explicit Resource Management
in ECMAScript once available
#794
With Typescript 5.2, ECMAScript feature "Explicit Resource Management" has been added, which could be great to have for this library to not forget to call
.stop
and.cleanup
only extra thing to consider would be to add options to disable automatic cleanup on dispose:
something along the lines of
MongoMemoryServer.create({ dispose: { onError: false, always: false } })
the semantics for the user would also change:
instead of something like:
the user could write:
this should also work on other runtimes than nodejs which dont support things like
process.on('unhandled*)
orprocess.on('exit')
to clean-up things (like deno)The text was updated successfully, but these errors were encountered: