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?


On 26 March 2015 at 12:14, Mike Thompson <[email protected]> wrote:
> On Thursday, March 26, 2015 at 10:53:38 PM UTC+11, Mike Thompson wrote:
>> All the handlers for one page should use "path" middleware to "focus" the 
>> page's handlers to that page's branch of "app-db".  Equally, each handler 
>> for that page should have middleware which checks that page's schema after 
>> each handler has run.  (This does mean your schema-checking middleware has 
>> to be put to the LEFT of the path middleware 
>> https://github.com/Day8/re-frame/wiki/Using-Handler-Middleware#6-ordering)
>
> Sorry,  correction:  the "schema-validation" middleware has to appear to the 
> RIGHT of the "path" middleware.
>
> So, when the handler is called, the path middleware has to run first, 
> suppling a pared-down "page db" to the middleware that follows (to its 
> RIGHT). So path has to be to the LEFT of any page-level-schema checking.
>
> And for extra credit, realise that you can have two lots of "path" middleware 
> in the pipeline.
>
> The first path (on the LEFT)  might deliver the "pages root in the db", and 
> then a later (to the RIGHT) middleware might deliver an even more specific 
> part of the page's db again. Just a thought.
>
>
> --
> 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.

-- 
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.

Reply via email to