Cancellable.cancel

Cancels the event. A cancelled event is not propagated further to the next listeners, if there's any.

interface Cancellable
pure nothrow @safe @nogc
void
cancel
()

Examples

example += (ExampleEvent event){ log("1"); };
example += (ExampleEvent event){ log("2"); event.cancel(); };
example += (ExampleEvent event){ log("3"); };
assert(event.callCancellableIfExists!ExampleEvent());

The example will print

1
2

Meta