Add merge-children-into-props function
This commit is contained in:
parent
55cf69582f
commit
ab34b5dbb6
1 changed files with 7 additions and 3 deletions
|
@ -32,9 +32,8 @@
|
||||||
(props element-props)
|
(props element-props)
|
||||||
(children element-children)) elm
|
(children element-children)) elm
|
||||||
(if (functionp type)
|
(if (functionp type)
|
||||||
(apply type (append props
|
(apply type
|
||||||
(and children
|
(merge-children-into-props props children))
|
||||||
(list :children children))))
|
|
||||||
elm)))
|
elm)))
|
||||||
|
|
||||||
(defun flatten (x)
|
(defun flatten (x)
|
||||||
|
@ -45,3 +44,8 @@
|
||||||
(car x)
|
(car x)
|
||||||
(rec (cdr x) acc))))))
|
(rec (cdr x) acc))))))
|
||||||
(rec x nil)))
|
(rec x nil)))
|
||||||
|
|
||||||
|
(defun merge-children-into-props (props children)
|
||||||
|
(append props
|
||||||
|
(and children
|
||||||
|
(list :children children))))
|
||||||
|
|
Loading…
Reference in a new issue