Registration for the filtered handler.registerFiltered
fn
auto registerFiltered(Args...)(ref Hap!Args hap,
scope bool delegate(Args) @safe predicate,
void delegate(Args) @safe handler) @safeRegister a filtered delegate handler that invokes only when a predicate matches.
The predicate receives the same arguments as the handler. When the predicate returns true, the handler is invoked; otherwise the event is silently skipped.
Parameters
hap | The hap to register on. |
predicate | A delegate that returns true when the handler should run. |
handler | The delegate handler to invoke when the predicate matches. |
Returns
A
fn
auto registerFiltered(Args...)(ref NothrowHap!Args hap,
scope bool delegate(Args) @safe nothrow predicate,
void delegate(Args) @safe nothrow handler) @safe nothrowditto