mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-10 00:12:32 +08:00

* Gather and document service API * Update changelog * Add NewServiceWithOptions * Revert static analyser change * Remove infinite loop in NewService[WithOptions] * Fix compiler warning in bindings command * Add test for NewServiceWithOptions * Update changelog * Fix service example --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
19 lines
436 B
Go
19 lines
436 B
Go
package other
|
|
|
|
import "github.com/wailsapp/wails/v3/pkg/application"
|
|
|
|
func CustomNewService[T any](srv T) application.Service {
|
|
return application.NewService(&srv)
|
|
}
|
|
|
|
func ServiceInitialiser[T any]() func(*T) application.Service {
|
|
return application.NewService[T]
|
|
}
|
|
|
|
func CustomNewServices[T any, U any]() []application.Service {
|
|
return []application.Service{
|
|
application.NewService(new(T)),
|
|
application.NewService(new(U)),
|
|
}
|
|
}
|