Changes the way before and after event callbacks are invoked.