Skip to content

Commit f60e679

Browse files
committed
Fix docs: add_hook instead of hook
1 parent 077f98b commit f60e679

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/Thunderhorse.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ event handling on the controller level.
10951095
10961096
=item * Hook notifications
10971097
1098-
$app->hook(error => sub ($controller, $ctx, $error) {
1098+
$app->add_hook(error => sub ($controller, $ctx, $error) {
10991099
warn "error occured: $error";
11001100
});
11011101
@@ -1118,7 +1118,7 @@ Thunderhorse defines a closed set of supported hooks:
11181118
11191119
=head4 startup
11201120
1121-
$app->hook(startup => sub ($state) { ... });
1121+
$app->add_hook(startup => sub ($state) { ... });
11221122
11231123
async sub on_startup ($self, $state) { ... }
11241124
@@ -1133,7 +1133,7 @@ This hook's method B<cannot be declared on a controller level>.
11331133
11341134
=head4 shutdown
11351135
1136-
$app->hook(shutdown => sub ($state) { ... });
1136+
$app->add_hook(shutdown => sub ($state) { ... });
11371137
11381138
async sub on_shutdown ($self, $state) { ... }
11391139
@@ -1148,7 +1148,7 @@ This hook's method B<cannot be declared on a controller level>.
11481148
11491149
=head4 error
11501150
1151-
$app->hook(error => sub ($controller, $ctx, error) { ... });
1151+
$app->add_hook(error => sub ($controller, $ctx, error) { ... });
11521152
11531153
async sub on_error ($self, $ctx, $error) { ... }
11541154
async sub on_error ($self, $controller, $ctx, $error) { ... }

0 commit comments

Comments
 (0)