Skip to content

Commit

Permalink
Remove unused exports.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Dec 9, 2023
1 parent 133169e commit a520095
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions packages/yew/src/server_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,49 +334,4 @@ where

rx
}

/// Renders Yew Application into a string Stream.
///
/// It would return a stream that yields a string for each rendered chunk.
pub async fn render_stream_async(self) -> impl Stream<Item = String> {
let Self {
create_props,
hydratable,
..
} = self;

let props = create_props();
LocalServerRenderer::<COMP>::with_props(props)
.hydratable(hydratable)
.render_stream()
}

/// Renders Yew Application into a string.
///
/// This method completely transfers the asynchronous control to the user,
/// and will not try to create additional async runtime tasks in the environment internally.
/// It's most suitable for single-threaded environments such as WASI.
pub async fn render_async(self) -> String {
let s = self.render_stream_async();
futures::pin_mut!(s);

s.await.collect::<String>().await
}

/// Renders Yew Application into a string.
///
/// This method completely transfers the asynchronous control to the user,
/// and will not try to create additional async runtime tasks in the environment internally.
/// It's most suitable for single-threaded environments such as WASI.
pub async fn render_to_string_async(self, w: &mut String) {
let s = self.render_stream_async();
futures::pin_mut!(s);

s.await
.for_each(|m| {
w.push_str(&m);
async {}
})
.await;
}
}

0 comments on commit a520095

Please sign in to comment.