Is your feature request related to a problem? Please describe.
When making web requests to servers, the returned data is sometimes streamed so that early results can be used immediately, instead of waiting for the whole request to finish. It also allows the use of never-ending streams which continuously stream data (as an alternative to websockets).
Describe the solution you'd like
The yew response body should contain a way to stream the data from the Fetch response body type.
The type returned from fetch: https://developer.mozilla.org/en-US/docs/Web/API/Response. The type of Response.body: https://developer.mozilla.org/en-US/docs/Web/API/Body/body.
More information
This is where we discard the stream today:
(std_web):
|
var promise = (@{binary}) ? response.arrayBuffer() : response.text(); |
(web_sys):
|
let data_promise = if self.binary { |
|
response.array_buffer() |
|
} else { |
|
response.text() |
|
} |
Is your feature request related to a problem? Please describe.
When making web requests to servers, the returned data is sometimes streamed so that early results can be used immediately, instead of waiting for the whole request to finish. It also allows the use of never-ending streams which continuously stream data (as an alternative to websockets).
Describe the solution you'd like
The yew response body should contain a way to stream the data from the
Fetchresponsebodytype.The type returned from
fetch: https://developer.mozilla.org/en-US/docs/Web/API/Response. The type ofResponse.body: https://developer.mozilla.org/en-US/docs/Web/API/Body/body.More information
This is where we discard the stream today:
(std_web):
yew/src/services/fetch/std_web.rs
Line 387 in 0ed0241
(web_sys):
yew/src/services/fetch/web_sys.rs
Lines 446 to 450 in 0ed0241