Cast function to VdomDictConstructor
(func: _CustomVdomDictConstructor)
| 245 | |
| 246 | |
| 247 | def custom_vdom_constructor(func: _CustomVdomDictConstructor) -> VdomDictConstructor: |
| 248 | """Cast function to VdomDictConstructor""" |
| 249 | |
| 250 | @wraps(func) |
| 251 | def wrapper(*attributes_and_children: Any) -> VdomDict: |
| 252 | attributes, children = separate_attributes_and_children(attributes_and_children) |
| 253 | key = attributes.pop("key", None) |
| 254 | attributes, event_handlers = separate_attributes_and_event_handlers(attributes) |
| 255 | return func(attributes, children, key, event_handlers) |
| 256 | |
| 257 | return cast(VdomDictConstructor, wrapper) |
| 258 | |
| 259 | |
| 260 | def separate_attributes_and_children( |