diff --git a/pixelgl/interface.go b/pixelgl/interface.go index 3dd71e696ff16e740301b241c3c5d656f437400b..16da0a6cbb33188e9156b5325ceb5749a6f1be51 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{}