Skip to content

Fix streaming example - #205

Merged
mattt merged 4 commits into
replicate:mainfrom
dkundel:patch-1
Feb 16, 2024
Merged

Fix streaming example#205
mattt merged 4 commits into
replicate:mainfrom
dkundel:patch-1

Conversation

@dkundel

@dkundel dkundel commented Feb 16, 2024

Copy link
Copy Markdown
Contributor

The example to use replicate.stream was wrongly checking the event type and was not producing any output. I adjusted the example so that it works. The event && in front of the event.event === 'output' check seems unnecessary as I can't think of a scenario where event would be false-y and even event.event seems to always be of type string but I left it for now in case I'm missing something.

The example to use replicate.stream was wrongly checking the event type and was not producing any output.
@mattt

mattt commented Feb 16, 2024

Copy link
Copy Markdown
Contributor

Related to #197

@mattt mattt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening a PR, @dkundel!

I'm happy to merge this in as-is. But for your consideration, I made some suggestions to use destructuring to avoid the event.event awkwardness. WDYT?

Comment thread README.md Outdated
Comment thread README.md Outdated
dkundel and others added 3 commits February 16, 2024 13:59
Co-authored-by: Mattt <mattt@me.com>
Co-authored-by: Mattt <mattt@me.com>
Removing the console.dir since it's no longer relevant
@dkundel

dkundel commented Feb 16, 2024

Copy link
Copy Markdown
Contributor Author

Looks good to me! I did remove the console.dir({event}) since it no longer felt relevant.

@mattt

mattt commented Feb 16, 2024

Copy link
Copy Markdown
Contributor

Excellent. Thanks again for your help with this, @dkundel! Merging now.

@mattt
mattt merged commit d09067c into replicate:main Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants