This commit is contained in:
Julien Calixte
2026-02-08 15:28:25 +01:00
parent 9f2a34554b
commit 3c69c8a241

12
main.ts
View File

@@ -1,23 +1,19 @@
import { Jetstream } from "@skyware/jetstream";
const jetstream = new Jetstream({
wantedCollections: [
"space.litenote.note",
],
wantedCollections: ["space.litenote.note"],
});
jetstream.onCreate("space.litenote.note", (event) => {
const { did, commit } = event
const { did, commit } = event;
console.log("create", did, commit);
});
jetstream.onUpdate("space.litenote.note", (event) => {
const { did, commit } = event
const { did, commit } = event;
console.log("update", did, commit);
});
jetstream.on("close", () => {
console.log("Connection closed, PartySocket will reconnect automatically");
});
@@ -26,7 +22,7 @@ jetstream.on("error", (error) => {
console.log("Connection closed with error", error);
});
console.log("launching jetstream")
console.log("launching jetstream");
jetstream.start();