Lazy Component generators have no need for capture semantics, so... we can make these simpler, behind the scenes.

This commit is contained in:
Ryan McGrath 2019-05-25 03:07:56 -07:00
parent 732f88dec0
commit 4e822fa383
No known key found for this signature in database
GPG key ID: 811674B62B666830
2 changed files with 6 additions and 2 deletions

View file

@ -40,7 +40,11 @@ pub enum RSX {
impl RSX {
/// Shorthand method for creating a new `RSX::VirtualNode` instance. Rarely should you call
/// this yourself; the `rsx! {}` macro handles this for you.
pub fn node<F: Fn() -> Arc<RwLock<Component>> + Send + Sync + 'static>(tag: &'static str, create_fn: F, props: Props) -> RSX {
pub fn node(
tag: &'static str,
create_fn: fn() -> Arc<RwLock<Component>>,
props: Props
) -> RSX {
RSX::VirtualNode(VirtualNode {
tag: tag,
create_component_fn: Arc::new(create_fn),