Fork me on GitHub
#re-frame
<
2017-07-10
>
gregg01:07:56

@andre yes indeed, that line of code seems to never be executed. As long as the mouse-up happens within the component, it all works fine. When outside however, the behaviour (while not a show stopper), is definitely quirky. Will add an issue.

madstap20:07:46

Has anyone tried the fsm approach from this post? http://blog.cognitect.com/blog/2017/5/22/restate-your-ui-using-state-machines-to-simplify-user-interface-development He mentions in the comments that it's part of a re-frame app.

tessellator20:07:25

@madstap Yeah, we're currently using something similar for re-frame apps where I work. It's worked pretty well for us.

tessellator20:07:00

We're prepping a lib to release as open-source that to help facilitate using FSMs with re-frame, but it's not quite ready yet.

madstap20:07:58

Cool, looking forward to seeing that

tessellator20:07:29

I'll see if we can get something out in the next few days (even if rough) and will tag up with you.

mattly20:07:45

I'm using it in a few places .. it's a useful pattern

stuartrexking21:07:55

I’m trying to understand how to use the enrich interceptor to do validation. I have a single field and I want to validate it’s contents before sending it’s value to a server. I’m trying to understand the flow of events and I want to make sure I have them correct. Am I on the right path with these steps: 1. Register an event handler with an enrich interceptor that does the validation. 2. Dispatch the registered event with the value of the input when a button is clicked. 3. In the event handler, assoc the value of the input in the db and include an :http-xhrio effect in the returned value. 4. The interceptor checks the value in the app-db and validates it. If the value is invalid, set a value in the app-db to indicate to the subscribed view to display an error AND then remove the :http-xhrio effect from the interceptor so the value is not submitted to the server.

stuartrexking21:07:05

Is this the right approach?

stuartrexking21:07:09

Is the last part of 4 correct, removing the effect to avoid submission to the server. Is that the place to do it?