laylatichy\nano\events
events are a way to extend the functionality of nano
they are called at specific points in the execution of nano, and allow you to listen for events and run code when they occur
useEvent(string $class): NanoEvent
useEvent
(string $class
): NanoEvent
php
class NanoStartListener implements NanoEventListener {
public function handle(NanoStartEvent $event): void {
// do something
}
}
useEvent(NanoStart::class)->attach(new NanoStartListener());