Closed holyjak closed 9 years ago
Well I'm wondering if I understand your use case correctly, but the works fine:
(defn square-range [& args]
(map (fn [x] (* x x)) (apply range args)))
(defcard square-range-example
(square-range 10))
You can edit the square range function and see the results as you work on it.
And you can do this as well:
(defcard example-func
((fn [a] (+ a 1)) 50))
Good point, thanks!
Currently I can pass a fn that returns a React component to a devcard. It would be nice if I could pass a function that returns just data and those were rendered using the edn renderer:
Motivation
While developing a function, I want to see its output. I could use REPL but then I need to manually run the fn. Using a devcard would be more automatic - and more cool. But admittedly, this is a very low priority "maybe nice to have" so I am not sure the added complexity is worth it.