On Thursday, March 26, 2015 at 11:22:10 PM UTC+11, Colin Yates wrote: > And this would need to be in the 'after' part of the middleware. > > I wonder if there is merit in splitting relevant handlers into > 'db-changes' and 'side-effects' (in my application, not re-frame) so > that the middleware can apply the changes and either bail if > validation fails or apply the side-effects... > > On a completely different question - how do you doc invocations of > your forms (e.g. register-handler) - I notice there is no capability > for a doc-string. Do you simply use commented lines above the form? >
You could perhaps use this two stage approach: (defn my-handler "lovely docs" [db [_ id]] .....) (register-handler :some-id std-middleware my-handler) The nice thing about splitting the handler from its registration is that you can now unit-test that lovely pure function (independently from its middleware). -- Mike -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
