D3vugu-components/components/navigation/events.go
David Vogel c149bbfc06 Use binding mechanism for the Pagination component
- Rename PaginationEvent to PaginateEvent
- Add PaginationBinder interface
2023-05-29 14:23:37 +02:00

24 lines
647 B
Go

package navigation
import "github.com/vugu/vugu"
type PaginateEvent struct {
vugu.DOMEvent
PaginationInfo // The current state of the pagination component.
}
// PaginationHandler is the interface for things that can handle PaginationEvent.
type PaginateHandler interface {
PaginateHandle(event PaginateEvent)
}
// PaginateFunc implements PaginateHandler as a function.
type PaginateFunc func(event PaginateEvent)
// PaginateHandle implements the PaginateHandler interface.
func (f PaginateFunc) PaginateHandle(event PaginateEvent) { f(event) }
// assert PaginateFunc implements PaginateHandler.
var _ PaginateHandler = PaginateFunc(nil)