hadashiA / VContainer

The extra fast, minimum code size, GC-free DI (Dependency Injection) library running on Unity Game Engine.
https://vcontainer.hadashikick.jp
MIT License
1.89k stars 165 forks source link

IContainerBuilder RegisterOnDisposeCallback option #571

Closed AlonTalmi closed 8 months ago

AlonTalmi commented 10 months ago

I added the option to listen to when any container created by the builder is disposed (but not scoped child containers).

I added a RegisterDisposeCallback to interface IContainerBuilder.

The dispose callback is called just before the container is disposed.

Added Unit Tests

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
vcontainer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 15, 2023 8:06am
hadashiA commented 9 months ago

@AlonTalmi The need is a bit subtle to me, but since there is no easy way to do this, I think it is a good idea. Thanks.

If you'd like, I'd be happy to resolve the conflicts on this as well.

Sorry for the delay in response!

hadashiA commented 8 months ago

603

I have created a PR on my end that incorporates your suggestions. Thanks a lot.