module

Events

Constants

VERSION = "0.1.0"

Instance methods

clear_handlers(name)
Source
event_exists(name : String)

Check if an event with name exists

Source
invoke_event(list : Array(_), *args)
Source
invoke_event(name, *args)

Invoke an event given by name, returns an Int32 with the amount of handlers run, false if the event didn't exist

Source
on(list : Array(_), &block)
Source
on(name, &block)

Add a block to the given event, returns a proc that removes the block

Creates the event if it doesn't exist already

Source
register_event(list : Array(_))
Source
register_event(name)

Registers a new event, gives it a name and returns it. If the event already exists, it's returned

Source
remove_handler(name, &block)

Removes a block from an event given by name

Source
unregister_event(name)

Unregisters the the event given by name

Source

Nested types