owja / ioc

:unicorn: lightweight (<1kb) inversion of control javascript library for dependency injection written in typescript
MIT License
287 stars 13 forks source link

Cache None-Singletons #18

Closed hbroer closed 5 years ago

hbroer commented 5 years ago

Is your feature request something you would just nice to see implemented? It would be nice if a dependency which got injected will not resolve on every call on the propery which resolves the dependency. It would be nice too if this behavior can be configured.

Describe the solution you'd like I am not shure which solution i wuld prefer. For myself i normaly use dependencies in singelton scope. But sometimes it could be usefull to resolve a dependency only once per instance. And this feature will improof performance too if caching is the default behavior.

Question

Which implementation whould you prefer? Or keep the current state? Or any other suggestion?