Skip to content

Commit

Permalink
chore: Update the streaming example to use iterator.return over dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Oct 22, 2024
1 parent 0a05b54 commit 886b4f1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions examples/timeline-with-streaming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ const subscribe = async (): Promise<void> => {
accessToken: "<TOKEN>",
});

using events = masto.hashtag.subscribe({ tag: "mastojs" });
console.log("subscribed to #mastojs");

for await (const event of events) {
for await (const event of masto.hashtag.subscribe({ tag: "mastojs" })) {
switch (event.event) {
case "update": {
console.log("new post", event.payload.content);
Expand Down

0 comments on commit 886b4f1

Please sign in to comment.