5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-08 01:11:06 +08:00
wails/v3/internal/generator/testcases/complex_instantiations/funcs.go
Fabio Massaioli 16ce1d3448
[v3] Service API cleanup and comments (#4024)
* 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>
2025-01-23 10:53:48 +00:00

15 lines
337 B
Go

package main
import "github.com/wailsapp/wails/v3/pkg/application"
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)),
}
}