registerFiltered

fnauto registerFiltered(Args...)(ref Hap!Args hap, bool delegate(Args) @safe predicate, void delegate(Args) @safe handler) @safe

Register 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 delivery is silently skipped.

Parameters

hapThe hap to register on.
predicateA delegate that returns true when the handler should run.
handlerThe delegate handler to invoke when the predicate matches.

Returns

A Registration for the filtered handler.

ditto

fnauto registerFiltered(Args...)(ref NothrowHap!Args hap, bool delegate(Args) @safe nothrow predicate, void delegate(Args) @safe nothrow handler) @safe nothrow

ditto