dependy 1.2.0 dependy: ^1.2.0 copied to clipboard
Dependy is a lightweight and flexible dependency injection (DI) library for Dart. It simplifies the management of services and their dependencies.
Changelog #
1.2.0 #
Features #
- EagerDependyModule:
- Introduced the
EagerDependyModule
class for eager resolution of dependencies. - Users can convert a
DependyModule
into anEagerDependyModule
- Introduced the
New Extension Method #
asEager()
:- Added an extension method on
DependyModule
that creates an instance ofEagerDependyModule
.
- Added an extension method on
Code Example #
final dependyModule = DependyModule(providers: { /* providers here */ });
// Eagerly resolve all providers
final eagerModule = await dependyModule.asEager();
// Now you can call services directly
final myService = eagerModule<MyService>();