-
Notifications
You must be signed in to change notification settings - Fork 4
support resolving multiple T into []T #8
Copy link
Copy link
Open
Description
Is your feature request related to a problem? Please describe.
when wiring multiple same types, currently I'm forced to create a new type from slice type and write a Provider function manually, like this
type Handlers []types.Handlers
func HandlersProvider() Handlers {
return []types.Handlers {
handler.NewHandlerA,
handler.NewHandlerB,
...
}Describe the solution you'd like
wire.Slice(
T,
providers...
)for example, like this
// this provides multiple T into single T, also this can be defined multiple times, everything will be joined to single type
wire.Slice(
[]types.EventHandler,
handler.NewHandlerA,
handler.NewHandlerB,
handler.NewHandlerC,
... // keep going
)Describe alternatives you've considered
Additional context
I implemented Proof of Concept in my forked branch. see below:
https://github.com/zzzz465/wire/tree/feat/wire-slice
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels