uber / needle

Compile-time safe Swift dependency injection framework
Apache License 2.0
1.84k stars 144 forks source link

Add a support of a weak instance with the identity. #452

Open ryu1sazae opened 1 year ago

ryu1sazae commented 1 year ago

Sometimes, we want to choose whether to share same ViewModel among different instances of View as long as the ViewModel's instance has been referenced somewhere. Like that, it is better to be able to choose without adding another definition for some situations I suppose.

We can use weak constructor I just added in this PR for such purpose.