EventHandler::Subscriptions
Inherits Reference < Object
A bag of Subscriptions that are torn down together. #on adds a tracked
subscription and returns it, so a single one can still be re-armed or
cancelled individually; #off cancels every remaining one, idempotently.
Instance methods
on(target, type : T.class, once = false, async = ::EventHandler.async?, at = ::EventHandler.at_end, &block : T -> Nil) : Subscription forall T
Subscribes block to type on target, tracking it for a later bulk
#off. Returns the created Subscription.