Skip to content

Commit

Permalink
docs: add example for injectAll optional dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
exuanbo committed Nov 23, 2024
1 parent 6686607 commit f4f420c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ import {inject, Type} from "di-wise";
class Wizard {
wand = inject(Wand, Type.Null);
// ^? (property) Wizard.wand: Wand | null

spells = injectAll(Spell, Type.Null);
// ^? (property) Wizard.spells: Spell[]
// => []
}
```

Expand Down

0 comments on commit f4f420c

Please sign in to comment.