rum

Simple, decomplected, isomorphic HTML UI library for Clojure and ClojureScript | 0.12.8 https://github.com/tonsky/rum/blob/gh-pages/CHANGELOG.md#0128
Matt Butler 2018-06-06T12:40:38.000541Z

Is there a reason that rum doesnt expose a create-component in its public api, basically defc without 5.

1. Wraps body into sablono/compile-html
     2. Generates render function from that
     3. Takes render function and mixins, builds React class from them
     4. Using that class, generates constructor fn [args]->ReactElement
     5. Defines top-level var with provided name and assigns ctor to it
For purposes of wrapping a component in an arbitrary fn.

2018-06-06T15:22:32.000093Z

I don’t understand. What can you do with component but to instantiate it?

Matt Butler 2018-06-06T15:54:29.000747Z

My imagined use case is needing to wrap a component so that it has closure over some vars etc.

(defn wrapped-component [x]
  (create-component {:render [:div x] :will-update #(... x ...))}
Without having to to use defcs and inspect the args to fetch out something for example.

Matt Butler 2018-06-06T15:55:34.000977Z

Maybe this isnt a distinct use case, I'm not claiming to be right, I would just expect to be able to define my own function that returns a component.

2018-06-06T18:03:00.000185Z

well your function can just call rum function, can’t it?