Support closure functions as callbacks to events.