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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user