feat: beaf up the use_state hook

This commit is contained in:
Jonathan Kelley committed 2021-07-08 09:29:12 -04:00
1 parent 7aec40d57e
commit e4cdb645aa
11 files changed
+214 -218

No files matched your search

+4 -4
View File
@@ -10,15 +10,15 @@ mod dom;
static HTML_CONTENT: &'static str = include_str!("./index.html");
pub fn launch(
builder: impl FnOnce(DioxusWebviewBuilder) -> DioxusWebviewBuilder,
root: FC<()>,
builder: impl FnOnce(DioxusWebviewBuilder) -> DioxusWebviewBuilder,
) -> anyhow::Result<()> {
launch_with_props(builder, (), root)
launch_with_props(root, (), builder)
}
pub fn launch_with_props<P: Properties + 'static>(
builder: impl FnOnce(DioxusWebviewBuilder) -> DioxusWebviewBuilder,
props: P,
root: FC<P>,
props: P,
builder: impl FnOnce(DioxusWebviewBuilder) -> DioxusWebviewBuilder,
) -> anyhow::Result<()> {
WebviewRenderer::run(root, props, builder)
}