diff --git a/pixelgl/interface.go b/pixelgl/interface.go index 3dd71e6..16da0a6 100644 --- a/pixelgl/interface.go +++ b/pixelgl/interface.go @@ -62,3 +62,12 @@ type ContextHolder struct { func (ch *ContextHolder) Do(sub func(ctx Context)) { sub(ch.Context) } + +type noOpDoer struct{} + +func (noOpDoer) Do(sub func(ctx Context)) { + sub(Context{}) +} + +// NoOpDoer is a Doer that just passes an empty context to the caller of Do. +var NoOpDoer = noOpDoer{}