Skip to content

Commit 2dcaf06

Browse files
authored
docs: fix respondWith event object (#775)
1 parent 3249ca7 commit 2dcaf06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/1.guide/4.event.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,18 @@ You must craft a response using the [`Response`](https://developer.mozilla.org/e
101101
> Prefer explicit `return` over `respondWith` as best practice.
102102
103103
> [!IMPORTANT]
104-
> A `responseWith` call will **always** take precedence over the returned value, from current and next event handlers. If there is no returned value, the request will continue until the end of the stack runner.
104+
> A `respondWith` call will **always** take precedence over the returned value, from current and next event handlers. If there is no returned value, the request will continue until the end of the stack runner.
105105
106106
**Example:**
107107

108108
```js
109-
defineEventHandler((event) => {
109+
defineEventHandler(async(event) => {
110110
await event.respondWith(new Response("Hello World"));
111111
return "..."; // DOES NOT WORKS
112112
});
113113

114114
app.use(
115-
defineEventHandler((event) => {
115+
defineEventHandler(async(event) => {
116116
await event.respondWith(new Response("Hello World"));
117117
return "..."; // DOES NOT WORK
118118
}),

0 commit comments

Comments
 (0)