reset method
Resets the module by disposing of its dependencies and reinitializing it.
Optionally accepts a callback that will be called for each disposed instance.
This method is useful for testing or when you need to reset the module's state.
Example:
await module.reset((instance) {
// Custom cleanup logic for each disposed instance
});
Implementation
Future<void> reset([void Function(dynamic)? instanceCallback]) async {
injector?.dispose(instanceCallback);
injector = null;
await init();
Logger.log('[$EasyModule] Reset $runtimeType');
}