@clojurians.net Iām so excited to see all the discussions here on Ghostwheel! Iām hoping people are finding your work as valuable and indispensable as me! :) Argh. I can't remember if I asked this already -- sorry if I did. (darned lack of searching on this Slack instance! :). I will submit PR with doc update this time. :) Is there any way to use Ghostwheel typing conventions for anonymous functions? I'm finding myself using the :pre to check arguments for Re-Frame event handlers. They look something like this, where anonymous event handling functions are associated with events. Thank you!!!
Hey @genekim, I vaguely remember having a conversation about this and I think it might have been with you. š My suggestion then was the same as it is now, which is not to use anonymous functions:
(defn event-handler [_ _] ...)
(rf/reg-event-db :initialize event-handler)
Ah yes! @clojurians.net I'll record this and put in PR, so I don't ask a third time! :)
I think (if possible) to have instrumented annonimous fns would be nice, (>fn [x] [int? => int?] ...)
š
Since Ghostwheel is simply using the existing clojure.spec APIs and to my knowledge they don't let you do instrumentation on anonymous functions, doing it that way isn't really possible at the moment. I think it shouldn't be too hard to implement actually, but it's still adding complexity which I'm not entirely convinced is worth it. I feel the cases where you'd need that you might as well create a top-level function, spec that and call it instead of the anonymous function.
and just like to say I'm loving ghostwheel, after proper setting up its great, but I feel like the default settings could be better, when I read the docs it makes me want all the instrumentation
Glad you're digging it, see below for my response to the other point. š
IMO would be better to have a lot of the instrumentation on
by default (instrument, outstrument and expound), and then let the user disable what it doesn't want