Skip to content

Commit

Permalink
Addressed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hughesjs authored Apr 20, 2024
1 parent edd3bb9 commit 65ab55d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ You have to pass a factory function `func` that returns an instance of an implem
There are certain circumstances where you might wish to register multiple implementations of the same interface and then get a list of all of the relevant implementations later on. For instance, you might have a modular design where each module registers an interface defining a page and then all of these get injected into your navigation bar in your main layout without your layout needing to know about each module.

> [!NOTE]
> To avoid this being a breaking change, this is an optional feature, to enable this you need to call:
> To avoid this being a breaking change and to prevent you from erroneously re-registering a type without expecting this behaviour, to enable this you need to call:
>
>```dart
>getIt.enableRegisteringMultipleInstancesOfOneType();
Expand All @@ -178,7 +178,7 @@ Then, later on you can fetch all instances of this interface by calling:
```dart
final Iterable<MyBase> instances = getIt.getAll<MyBase>();
```

The returned `Iterable` will then contain all registered instances of the requested interface with or without an instance name.
There is also an `async` implementation available for this:

```dart
Expand Down

0 comments on commit 65ab55d

Please sign in to comment.