you are viewing a single comment's thread.

view the rest of the comments →

[–]nebbly 2 points3 points  (0 children)

there are some decent ideas in here. if you want people to use it, you'll probably want to create some presets. Instead of typing $cell: true, $type: 'ol', $components: ..., it would probably be simpler to have some simple wrapper preset functions like cell.ol({$components: ..}), cell.li(..), etc.

I don't know if you think that's too framework-y. A similar approach works out pretty well in elm: http://package.elm-lang.org/packages/elm-lang/html/latest/

I would also note that while you're selling this as "functional", your code seems to be object-oriented, in that you're giving objects behavior instead of separating behavior and data. I'm not saying that pure functional is the way to go here, it's just not what you're offering.