Skip to content

Accept stream instances instead of readers #770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025
Merged

Accept stream instances instead of readers #770

merged 1 commit into from
Apr 30, 2025

Conversation

Acconut
Copy link
Member

@Acconut Acconut commented Apr 29, 2025

Readable streams in the Web Streams API are composed of the actual stream object and a separate reader object. This is different than Node.js streams, where they are combined into one object.

Currently the Upload constructor will accept instances of ReadableStreamDefaultReader, i.e. the reader and not the actual stream. I'm considering switching this to take the actual stream instance (ReadableStream) and then obtain a reader internally.

This would align tus-js-client closer with how the Fetch API accepts streams as request content.

@Acconut Acconut self-assigned this Apr 29, 2025
@Acconut Acconut merged commit e636062 into main Apr 30, 2025
8 of 10 checks passed
@Acconut Acconut deleted the webstream branch April 30, 2025 10:27
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.

1 participant