darto_inject 1.0.1
darto_inject: ^1.0.1 copied to clipboard
Typed dependency injection for Darto — Provider<T>, request scope, lifecycle hooks and per-test overrides. No codegen, no decorators.
1.0.1 #
- Fix a runtime type error when disposing a provider read through a
dynamic-narrowed handle (e.g. duringdi.warmup()/readAsync<dynamic>): the disposer is now bound with the provider's reified type viadisposerFor(value), avoiding a covariant field-read crash.
1.0.0 #
- Initial release.
Provider<T>(sync) andAsyncProvider<T>(async) — typed factories with app- or request-scope.Dicontainer: caches instances per scope, supportsoverride(...)for tests and runsonDisposecallbacks in reverse-creation order.- Context extension
c.read(provider)/c.readAsync(provider)and built-incontextProviderexposing the currentContextinside request-scope factories. di(container).middleware()— registers a Darto middleware that opens a request scope per request and disposes it on completion.Feature(providers, routes)+app.install([prefix], feature)— group a set of providers with their routes; install once.