Added the notion of controllers and a dispatcher which will queue up operations
15 lines
228 B
Go
15 lines
228 B
Go
package uimodels
|
|
|
|
import "context"
|
|
|
|
type Operation interface {
|
|
Execute(ctx context.Context) error
|
|
}
|
|
|
|
type OperationFn func(ctx context.Context) error
|
|
|
|
func (f OperationFn) Execute(ctx context.Context) error {
|
|
return f(ctx)
|
|
}
|
|
|