fix typos in docs
Signed-off-by: Juan Pablo Garcia Ripa <sarabadu@gmail.com>
This commit is contained in:
@@ -225,7 +225,7 @@ This allows you to provide more advanced options for the service implementation
|
||||
|
||||
## Multiton
|
||||
|
||||
By default the service reference will point to a singleton instance of the service. This meand if a new service factory uses this reference will override the previous one. This is the most common use-case, but in some cases you may want to have multiple instances of the same service.
|
||||
By default the service reference will point to a singleton instance of the service. This mean if a new service factory uses this reference will override the previous one. This is the most common use-case, but in some cases you may want to have multiple instances of the same service.
|
||||
For some services, is desirable to extend the functionality instead of overriding it. For example, some services could have many handler to address a specific event, and you may want to add a new handler instead of overriding the previous one. In this case, you can use the `multiton` option when creating the service reference:
|
||||
|
||||
```ts
|
||||
@@ -242,7 +242,7 @@ export const fooServiceRef = createServiceRef<FooService>({
|
||||
});
|
||||
```
|
||||
|
||||
When adding this serviceRef ad dependency to a factory, the factory will receive an array of instances instead of a single instance:
|
||||
When adding this `serviceRef` as a dependency to a factory, the factory will receive an array of instances instead of a single instance:
|
||||
|
||||
```ts
|
||||
deps: {fooServices: fooServiceRef},
|
||||
|
||||
Reference in New Issue
Block a user