From 707eb3989dfd3ddf32dc14564ba06a4649935905 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Thu, 11 Jul 2024 10:16:25 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Camila Belo Signed-off-by: Patrik Oldsberg --- .changeset/spotty-apricots-tan.md | 2 +- docs/backend-system/architecture/03-services.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.changeset/spotty-apricots-tan.md b/.changeset/spotty-apricots-tan.md index 2b88e3a7f5..8eea2b1dce 100644 --- a/.changeset/spotty-apricots-tan.md +++ b/.changeset/spotty-apricots-tan.md @@ -41,7 +41,7 @@ export class DefaultFooService implements FooService { A user that wishes to customize the service can then easily do so by defining their own factory: ```ts -export const fooServiceFactory = createServiceFactory({ +export const customFooServiceFactory = createServiceFactory({ service: fooServiceRef, deps: { logger: coreServices.logger }, factory({ logger }) { diff --git a/docs/backend-system/architecture/03-services.md b/docs/backend-system/architecture/03-services.md index 7d6824c41e..e1d86164c3 100644 --- a/docs/backend-system/architecture/03-services.md +++ b/docs/backend-system/architecture/03-services.md @@ -192,7 +192,7 @@ When defining a default factory for a service, it is possible for it to end up w ## Service Factory Customization -When declaring a service factory you may also want to make the export the building blocks of the implementation itself. This is to allow for further customization of the service implementation through code, beyond what is possible with static configuration, without the need to re-implement the entire service from scratch. For example, we might export our example `DefaultFooService` class, while moving construction to a static factory method to make it easier to evolve: +When declaring a service factory you may also want to make the export the building blocks of the implementation itself. This is to allow for further customization of the service implementation through code, beyond what is possible with static configuration, without the need to re-implement the entire service from scratch. For example, we might export our example `DefaultFooService` class, while moving construction to a static `create` factory method to make it easier to evolve: ```ts export class DefaultFooService { @@ -222,4 +222,4 @@ export const customFooServiceFactory = createServiceFactory({ }); ``` -This allows lets you provide more advanced options for the service implementation that couldn't be expressed through static configuration. It also gives users of the service implementation access to other services through dependency injection, which can be useful for their customizations. +This allows you to provide more advanced options for the service implementation that couldn't be expressed through static configuration. It also gives users of the service implementation access to other services through dependency injection, which can be useful for their customizations.