Skip to content
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

transform Stream #4

Open
DrSensor opened this issue Feb 7, 2023 · 0 comments
Open

transform Stream #4

DrSensor opened this issue Feb 7, 2023 · 0 comments

Comments

@DrSensor
Copy link
Owner

DrSensor commented Feb 7, 2023

Make transform function behave differently when the input is Stream

rewrite.isStreaming // false
rewrite.transform(response.body as ReadableStream)
rewrite.isStreaming // true
rewrite.peek() // some string
await sleep(600 * ms)
rewrite.peek() // some string + additional string
rewrite.flush() // end stream
rewrite.isStreaming // false
rewrite.peek() // empty string

it will flush and immediately pass the output when calling .then

rewrite.isStreaming // false
await rewrite.transform(response.body as ReadableStream) // some string
rewrite.isStreaming // false
rewrite.peek() // empty string
@DrSensor DrSensor changed the title transform Response object transform Stream Feb 7, 2023
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

No branches or pull requests

1 participant