onEvent once

Is it possible to write an onEvent event that executes once and then gets destroyed? Is it possible to implement it so that the event doesn’t consume CPU time after it’s executed once?
This is how I’ve implemented it for now. But I consider it a workaround.

let btnLeftEventDone = false;

brick.buttonLeft.onEvent(ButtonEvent.Pressed, function () {

if (btnLeftEventDone) return;

btnLeftEventDone = true;

// My Code

})