Closed hbroer closed 5 years ago
Merging #17 into master will not change coverage. The diff coverage is
100%
.
@@ Coverage Diff @@
## master #17 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 3 3
Lines 48 52 +4
Branches 8 9 +1
=====================================
+ Hits 48 52 +4
Impacted Files | Coverage Δ | |
---|---|---|
src/index.ts | 100% <100%> (ø) |
:arrow_up: |
src/ioc/inject.ts | 100% <100%> (ø) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update e3a634f...17d8de0. Read the comment docs.
This is a suggestion of a configurable cache. It is made with extensibility in mind (Tags).
Without caching a dependency, configured without the
.inSingeltonScope()
option, will resolve new data on every get of the property. With caching it will only resolved once per instance.In this example getting
this.notCached
will create each call a new instance ofMyService
which is the current behavior. On the contrary, callingthis.cached
will resolve only once.The alternative of the configurable cache, a static cache.
Bundle Sizes
Question
Which implementation whould you prefer? Or keep the current state? Or any other suggestion?
Links
Issue: Cache None-Singletons Suggestion: Static Cache