mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 04:40:41 +08:00

* Add single listener deregistration * Return function to stop listening, updates types * Add missing returns, improve documentation * Duplicate interface in go * Define eventName * Use lo instead for filtering * Move logger to Interface. Add sample test. * Add vite test for events * Add js test workflow * Add corresponding go method to remove all events * Update documentation Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
12 lines
384 B
Go
12 lines
384 B
Go
package frontend
|
|
|
|
type Events interface {
|
|
On(eventName string, callback func(...interface{})) func()
|
|
OnMultiple(eventName string, callback func(...interface{}), counter int) func()
|
|
Once(eventName string, callback func(...interface{})) func()
|
|
Emit(eventName string, data ...interface{})
|
|
Off(eventName string)
|
|
OffAll()
|
|
Notify(sender Frontend, name string, data ...interface{})
|
|
}
|