diff --git a/README.md b/README.md index 1dfe4a7..d874385 100644 --- a/README.md +++ b/README.md @@ -136,8 +136,7 @@ const app = new Hono() ### Do not provide an initialization function ```ts -const userServiceDep = new Dependency(); - +const userServiceDep = new Dependency(() => null); ``` ## API @@ -168,6 +167,14 @@ interface Dependency { */ injection(service: Service): this + /** + * Clear injected service. + */ + clearInjected(): this { + this.service = undefined; + return this; + } + /** * Creates a middleware that injects the service into the context. * @param contextKey - Optionally override the key used to store the service in the context.