|
@@ -254,7 +254,7 @@ impl VirtualDom {
|
|
/// ```
|
|
/// ```
|
|
///
|
|
///
|
|
/// Note: the VirtualDom is not progressed, you must either "run_with_deadline" or use "rebuild" to progress it.
|
|
/// Note: the VirtualDom is not progressed, you must either "run_with_deadline" or use "rebuild" to progress it.
|
|
- pub fn new(app: fn() -> Element) -> Self {
|
|
|
|
|
|
+ pub fn new<F: Fn() -> Element + Clone + 'static>(app: F) -> Self {
|
|
Self::new_with_props(app, ())
|
|
Self::new_with_props(app, ())
|
|
}
|
|
}
|
|
|
|
|
|
@@ -313,7 +313,7 @@ impl VirtualDom {
|
|
}
|
|
}
|
|
|
|
|
|
/// Create a new virtualdom and build it immediately
|
|
/// Create a new virtualdom and build it immediately
|
|
- pub fn prebuilt(app: fn() -> Element) -> Self {
|
|
|
|
|
|
+ pub fn prebuilt<F: Fn() -> Element + Clone + 'static>(app: F) -> Self {
|
|
let mut dom = Self::new(app);
|
|
let mut dom = Self::new(app);
|
|
dom.rebuild_in_place();
|
|
dom.rebuild_in_place();
|
|
dom
|
|
dom
|