dart_frog_dependency_cacher

Creator: coderz1093

Last updated:

0 purchases

dart_frog_dependency_cacher Image
dart_frog_dependency_cacher Images

Languages

Categories

Add to Cart

Description:

dart frog dependency cacher

Dependency Cacher for Dart Frog #
An opinionated caching and dependency injection suite for Dart Frog.
This packaged supports:

Only creating dependencies the first time they are requested.
Caching dependencies so they are only built once.
Allows for dependencies to be built asynchronously.
Allows caching and requesting via a unique key if you need to cache dependencies of the same type.

Providing a dependency #
Handler middleware(Handler handler) {
return handler
.use(
futureProvider<MyDependency>(
(context, {key}) => makeMyDependencyAsync();
)
);
}
copied to clipboard
Using a dependency #
Response onRequest(RequestContext context) async {
final myDependency = await context.readAsync<MyDependency>();
/// use myDependency...
}
copied to clipboard

Made with 💙 by Morel Technology

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.