0.5.0
What's Changed
- add container disposal support by @molszanski in #26
- add destructuring support by @molszanski in #24
- init website by @molszanski in #29
- project cleanup by @molszanski in #28
- Cleanup by @molszanski in #30
- Healthy repo by @molszanski in #32
Container Disposal
basic usage
import { createContainer } from "iti"
container = createContainer()
.add({ a: () => "123" })
.addDisposer({ a: () => {} })
container.get("a") === "123" // true
await container.disposeAll() // Promise<void>
async case
const container = createContainer()
.add(() => ({
dbConnection: async () => {
/** connect to db and return an instance */
},
}))
.addDisposer({
// ↓ `db` is a resolved value of a `dbConnection` token. Pretty handy
dbConnection: (db) => db.close(),
})
const db = await container.get("dbConnection")
await container.disposeAll()
Much Better Ts performance
Some huge projects consumed too much RAM and had some perf limits:
i18next/react-i18next#1417
TS2589: Type instantiation is excessively deep and possibly infinite
This was one of know issues:
https://itijs.org/docs/patterns-and-tips#known-issues
I believe that the issue is solved with this release
Full Changelog: 0.4.2...0.5.0