Skip to content

Commit 57681a5

Browse files
committed
json docs
1 parent 38d6e5f commit 57681a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/official-site/sqlpage/migrations/11_json.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ eventSource.onmessage = function (event) {
152152
const user = JSON.parse(event.data);
153153
console.log(user.username);
154154
}
155+
eventSource.onerror = function () {
156+
eventSource.close(); // do not reconnect after reading all the data
157+
}
155158
```
156159
'
157160
);

0 commit comments

Comments
 (0)