I'm seeing more and more that create taking a function is unergonomic for many components, because the things used for creation must be moved into the closure, even if really they are just required by reference for some initial setup.
It is nice, though, to have the closure variant, in particular when a component needs no external state but loads all configuration from config alone.
I suggest we simply split component creation, such that create just takes a ComponentDefinition instance and a new create_fn maintains the current shape.
I'm seeing more and more that
createtaking a function is unergonomic for many components, because the things used for creation must be moved into the closure, even if really they are just required by reference for some initial setup.It is nice, though, to have the closure variant, in particular when a component needs no external state but loads all configuration from config alone.
I suggest we simply split component creation, such that
createjust takes aComponentDefinitioninstance and a newcreate_fnmaintains the current shape.