@clojurians.net Touching an area of a reframe app that I wrote long ago, and was bitten by typing error that took 15m to find and fix. Is there an obvious way to use ghostwheel for re-frame event handlers? (I'll post example of one in a couple of minutes...) Thank you! (This is an area where I tend to screw up quite a bit!)
Example of an anonymous function in re-frame event handler -- is there any way to use ghostwheel to type check these? What has bitten me lately: strings vs ints vs maps, just in the "callers" and "callers" to this one event handler! ( I made "hk" a map, I found to my chagrin last night! :) @clojurians.net
Whoa. Just read this. What a marvelous shorthand for nilable!!! @clojurians.net
@clojurians.net upon some thinking, I'm guessing supporting anonymous functions is probably not a great thing for ghostwheel -- I'll try using the more standard :pre assert notation on those functions, and definitely increasing the documentation I use on non-typical arg types, to preventing surprising myself months from now!!! :)
Hey @genekim , support for anonymous functions wouldn't work too great for a number of reasons, but it's also not really needed – my recommendation for now is to use named functions:
(>defn foobar ...)
(re-frame/reg-event-fx :something/foo foobar)
You might want to optimise this with some macro, some support for which is coming with the next Ghostwheel release.
@clojurians.net Ah! That looks terrific -- and of course, I'm slapping myself on the forehead that I didn't think of that... Especially since for months, I've been wanting to pull out some of these anonymous functions to write some automated tests to confirm correct functionality of some of the more fiddly ones. I'll surely get cracking on my first one today! :) (Seems more fun than all the urgent stuff I should be working on! :)
It's called 'productive procrastination' and it can move mountains. 😄