Thanks, this was helpful for me. Just one notice:
To get out the message, "wire('session')" was not working for me, I used $this instead:
function example1(HookEvent $event) {
$page = $event->arguments[0];
$this->message("Hello World 2 ! You saved {$page->path}");
}
$pages->addHookAfter('Pages::save', null, 'example1');