docs: fix missing closing parenthesis in services guide (#33910)

* docs: fix missing closing parenthesis in services guide

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor

* Make `transform` optional in `DefaultFooService.create` and factory options

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor

---------

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2026-04-15 12:02:30 +02:00
committed by GitHub
parent a321fc0c47
commit a54350bc5b
@@ -195,8 +195,8 @@ When declaring a service factory you may also want to make the export the buildi
```ts
export class DefaultFooService {
static create(options: { transform: (foo: string) => string }) {
return new DefaultFooService(options.transform ?? ((foo) => foo);
static create(options: { transform?: (foo: string) => string }) {
return new DefaultFooService(options.transform ?? (foo => foo));
}
private constructor(private readonly transform: (foo: string) => string) {}
@@ -264,7 +264,7 @@ In some cases it might be beneficial to allow users of your service factory to p
```ts
const fooServiceFactoryWithOptions = (options?: {
transform: (foo: string) => string;
transform?: (foo: string) => string;
}) =>
createServiceFactory<FooService>({
service: fooServiceRef,